Changeset 0572abcf


Ignore:
Timestamp:
Dec 24, 2009, 10:36:20 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
Children:
ac374fc
Parents:
d771d1b (diff), 9f026c1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge branch 'release-1.5'
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r82fbdf0 r1fd6086  
     11.5
     2 * Allow ^Z to be rebound. -nelhage@mit.edu
     3 * Skip some IRC admin messages by default, controlled by irc:skip -alexmv@mit.edu
     4 * Reconnect and re-join channels on IRC disconnect -alexmv@mit.edu
     5 * Correct the --with-libzephyr help string to --with-zephyr. -andersk@mit.edu
     6 * Improve performance narrowing to certain filters. -nelhage@mit.edu
     7 * Add completion for :filter* -adehnert@mit.edu
     8 * Fix filter* -adehnert@mit.edu
     9 * Mark the current mark with an asterisk -davidben@mit.edu
     10 * Complete class names for the 'unsub' command. -nelhage@mit.edu
     11 * Make control characters human-readable -kcr@1ts.org
     12 * Further complete the show command -davidben@mit.edu
     13 * Fix a bug reflowing text in the editwin. -davidben@mit.edu
     14 * Reconnect to MUCs when reconnecting to Jabber. -asedeno@mit.edu
     15 * Fix spurious trailing newlines in zsigs. -andersk@mit.edu
     16 * Fix the behavior of the zsig variable.  -kcr@1ts.org
     17 * Drop owl_animate_hack. -asedeno@mit.edu
     18 * Add IRC server and channel listing to buddylist -alexmv@mit.edu
     19 * Make Jabber try to reconnect when disconnected, at exponential intervals -alexmv@mit.edu
     20 * Better documentation for jabberlogout. -asedeno@mit.edu
     21 * jabberlogout -a --> jabberlogout -A -asedeno@mit.edu
     22 * Change the default jabber resource to 'barnowl' -asedeno@mit.edu
     23 * Updated Jabber documentation for consistency. -zhangc@mit.edu
     24 * Document :bindkey more clearly. -geofft@mit.edu
     25
    1261.4
    227 * Fix description of edit:history-next -davidben@mit.edu
  • Makefile.am

    r8df704f r89982ec  
    11ACLOCAL_AMFLAGS = -I m4
    22
    3 GIT_FLAGS=$(if $(wildcard .git),-DGIT_VERSION=$(subst barnowl-,,$(shell git describe --match='barnowl-*' HEAD)))
     3GIT_DESCRIPTION := $(if $(wildcard .git),$(shell git describe --match='barnowl-*' HEAD 2>/dev/null))
     4GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%))
    45
    56bin_PROGRAMS = barnowl.bin
  • commands.c

    r8c97fa1 r6700c605  
    320320  OWLCMD_INT("recv:setshift", owl_command_set_shift, OWL_CTX_INTERACTIVE,
    321321              "scrolls receive window to specified position", "", ""),
    322 
    323   OWLCMD_VOID("recv:shiftleft", owl_command_shift_left, OWL_CTX_INTERACTIVE,
    324               "scrolls receive window to the left", "", ""),
    325 
    326   OWLCMD_VOID("recv:shiftright", owl_command_shift_right, OWL_CTX_INTERACTIVE,
    327               "scrolls receive window to the left", "", ""),
    328322
    329323  OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown,
     
    13611355  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    13621356  owl_global_set_needrefresh(&g);
    1363 }
    1364 
    1365 void owl_command_shift_left(void)
    1366 {
    1367   owl_function_shift_left();
    1368 }
    1369 
    1370 void owl_command_shift_right(void)
    1371 {
    1372   owl_function_shift_right();
    13731357}
    13741358
  • configure.ac

    r438009c r980fa31  
    11dnl Process this file with autoconf to produce a configure script.
    2 AC_INIT([BarnOwl],[1.5pre1],[bug-barnowl@mit.edu])
     2AC_INIT([BarnOwl],[1.5rc2],[bug-barnowl@mit.edu])
    33AM_INIT_AUTOMAKE([-Wall foreign])
    44m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  • editwin.c

    re9c6fc8 rc471e85  
    526526  do {
    527527    werase(e->curswin);
    528     if (e->topindex == -1 || e->index < e->topindex
    529         || (e->index == e->topindex
    530             && e->topindex > 0
    531             && e->buff[e->topindex-1] != '\n'))
     528
     529    if (e->topindex == -1 || e->index < e->topindex)
    532530      oe_reframe(e);
    533531
     
    654652  }
    655653
     654  /* recenter if needed */
     655  if (start <= e->topindex)
     656    owl_editwin_recenter(e);
     657
    656658  return change;
    657659}
  • functions.c

    r8c97fa1 rcce5dbd  
    31363136#endif
    31373137
    3138   if(aim && zephyr) {
    3139       if(owl_perlconfig_is_function("BarnOwl::Hooks::_get_blist")) {
    3140           char * perlblist = owl_perlconfig_execute("BarnOwl::Hooks::_get_blist()");
    3141           if(perlblist) {
    3142               owl_fmtext_append_ztext(&fm, perlblist);
    3143               owl_free(perlblist);
    3144           }
     3138  if (aim && zephyr) {
     3139    if (owl_perlconfig_is_function("BarnOwl::Hooks::_get_blist")) {
     3140      char * perlblist = owl_perlconfig_execute("BarnOwl::Hooks::_get_blist()");
     3141      if (perlblist) {
     3142        owl_fmtext_append_ztext(&fm, perlblist);
     3143        owl_free(perlblist);
    31453144      }
     3145    }
    31463146  }
    31473147
  • perl/lib/BarnOwl.pm

    r1b9a163 r6700c605  
    3838use BarnOwl::Completion;
    3939
     40use List::Util qw(max);
     41
    4042=head1 NAME
    4143
     
    421423                       });
    422424
     425    # Receive window scrolling
     426    BarnOwl::new_command("recv:shiftleft",
     427                        \&BarnOwl::recv_shift_left,
     428                        {
     429                            summary => "scrolls receive window to the left",
     430                            usage => "recv:shiftleft [<amount>]",
     431                            description => <<END_DESCR
     432By default, scroll left by 10 columns. Passing no arguments or 0 activates this default behavior.
     433Otherwise, scroll by the number of columns specified as the argument.
     434END_DESCR
     435                        });
     436
     437    BarnOwl::new_command("recv:shiftright",
     438                        \&BarnOwl::recv_shift_right,
     439                        {
     440                            summary => "scrolls receive window to the right",
     441                            usage => "recv:shiftright [<amount>]",
     442                            description => <<END_DESCR
     443By default, scroll right by 10 columns. Passing no arguments or 0 activates this default behavior.
     444Otherwise, scroll by the number of columns specified as the argument.
     445END_DESCR
     446                        });
     447
    423448}
    424449
     
    485510}
    486511
     512=head3 Receive window scrolling
     513
     514Permit scrolling the receive window left or right by arbitrary
     515amounts (with a default of 10 characters).
     516
     517=cut
     518
     519sub recv_shift_left
     520{
     521    my $func = shift;
     522    my $delta = shift;
     523    $delta = 10 unless int($delta) > 0;
     524    my $shift = BarnOwl::recv_getshift();
     525    if($shift > 0) {
     526        BarnOwl::recv_setshift(max(0, $shift-$delta));
     527    } else {
     528        return "Already full left";
     529    }
     530}
     531
     532sub recv_shift_right
     533{
     534    my $func = shift;
     535    my $delta = shift;
     536    $delta = 10 unless int($delta) > 0;
     537    my $shift = BarnOwl::recv_getshift();
     538    BarnOwl::recv_setshift($shift+$delta);
     539}
     540
    487541=head3 default_zephyr_signature
    488542
  • perl/lib/BarnOwl/Hooks.pm

    re2f7963 r7574eed  
    184184
    185185sub _get_blist {
    186     return join("\n", $getBuddyList->run);
     186    my @results = grep defined, $getBuddyList->run;
     187    s/^\s+|\s+$//sg for (@results);
     188    return join("\n", grep {length($_)} @results);
    187189}
    188190
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    rf81176c r618a980  
    9494        my $conn = $ircnets{$net};
    9595        my ($nick, $server) = ($conn->nick, $conn->server);
    96         $list .= BarnOwl::Style::boldify("IRC channels for $net ($nick\@$server)\n");
     96        $list .= BarnOwl::Style::boldify("IRC channels for $net ($nick\@$server)");
     97        $list .= "\n";
    9798
    9899        for my $chan (keys %channels) {
     
    100101            $list .= "  $chan\n";
    101102        }
    102         $list .= "\n";
    103103    }
    104104
     
    167167
    168168    BarnOwl::new_command(
    169         'irc-disconnect' => mk_irc_command( \&cmd_disconnect ),
     169        'irc-disconnect' => \&cmd_disconnect,
    170170        {
    171171            summary => 'Disconnect from an IRC server',
     
    391391
    392392sub cmd_disconnect {
    393     my $cmd = shift;
    394     my $conn = shift;
    395     $conn->conn->disconnect;
    396     return;
     393    # Such a hack
     394    local *get_connection_by_alias = sub {
     395        my $key = shift;
     396        return $ircnets{$key} if exists $ircnets{$key};
     397        return $reconnect{$key}{conn} if exists $reconnect{$key};
     398        die("No such ircnet: $key\n");
     399    };
     400
     401    mk_irc_command(
     402        sub {
     403            my $cmd = shift;
     404            my $conn = shift;
     405            if ($conn->conn->connected) {
     406                $conn->conn->disconnect;
     407            } elsif ($reconnect{$conn->alias}) {
     408                BarnOwl::admin_message('IRC',
     409                                       "[" . $conn->alias . "] Reconnect cancelled");
     410                delete $reconnect{$conn->alias};
     411            }
     412        }
     413    )->(@_);
    397414}
    398415
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r99c1f46 r618a980  
    322322            },
    323323        } );
     324    $BarnOwl::Module::IRC::reconnect{$self->alias}{conn} = $self;
    324325}
    325326
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    rf1a2736 r0cfa6ee  
    136136
    137137    foreach my $jid ( $conn->getJIDs() ) {
    138 
    139         next unless $conn->jidActive($jid) or $conn->tryReconnect($jid);
     138        next if $conn->jidActive($jid);
     139        $conn->tryReconnect($jid);
     140    }
     141
     142    foreach my $jid ( $conn->getJIDs() ) {
     143        next unless $conn->jidActive($jid);
    140144
    141145        my $client = $conn->getConnectionFromJID($jid);
     
    210214    my $roster = $conn->getRosterFromJID($jid);
    211215    if ($roster) {
    212         $blist .= "\n" . BarnOwl::Style::boldify("Jabber roster for $jid\n");
     216        $blist .= BarnOwl::Style::boldify("Jabber roster for $jid\n");
    213217
    214218        my @gTexts = ();
     
    465469                    }
    466470                );
    467                 my $roster = $conn->getRosterFromJID($jidStr);
    468                 $roster->fetch();
    469                 $client->PresenceSend( priority => 1 );
    470                 my $fullJid = $client->{SESSION}->{FULLJID} || $jidStr;
    471                 $conn->renameConnection($jidStr, $fullJid);
    472                 queue_admin_msg("Connected to jabber as $fullJid");
    473                 # The remove_io_dispatch() method is called from the
    474                 # ConnectionManager's removeConnection() method.
    475                 $client->{fileno} = $client->getSocket()->fileno();
    476                 #queue_admin_msg("Connected to jabber as $fullJid ($client->{fileno})");
    477                 BarnOwl::add_io_dispatch($client->{fileno}, 'r', sub { $client->OwlProcess($fullJid) });
    478 
    479                 # populate completion from roster.
    480                 for my $buddy ( $roster->jids('all') ) {
    481                     my %jq  = $roster->query($buddy);
    482                     my $name = $jq{name} || $buddy->GetUserID();
    483                     $completion_jids{$name} = 1;
    484                     $completion_jids{$buddy->GetJID()} = 1;
    485                 }
    486                 $vars{idletime} |= BarnOwl::getidletime();
    487                 unless (exists $vars{keepAliveTimer}) {
    488                     $vars{keepAliveTimer} = BarnOwl::Timer->new({
    489                         'after' => 5,
    490                         'interval' => 5,
    491                         'cb' => sub { BarnOwl::Module::Jabber::do_keep_alive_and_auto_away(@_) }
    492                                                                 });
    493                 }
     471                $client->onConnect($conn, $jidStr);
    494472            }
    495473        }
     
    10591037sub process_incoming_chat_message {
    10601038    my ( $sid, $j ) = @_;
    1061     if ($j->DefinedBody()) {
     1039    if ($j->DefinedBody() || BarnOwl::getvar('jabber:spew') eq 'on') {
    10621040        BarnOwl::queue_message( j2o( $j, { direction => 'in',
    10631041                                           sid => $sid } ) );
     
    11051083    #    }
    11061084    #
    1107     if(BarnOwl::getvar('jabber:spew') eq 'on') {
     1085    if ($j->DefinedBody() || BarnOwl::getvar('jabber:spew') eq 'on') {
    11081086        BarnOwl::queue_message( BarnOwl::Message->new(%jhash) );
    11091087    }
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber/Connection.pm

    r8590774 r0dbb7d2  
    163163}
    164164
     165=head2 OnConnect
     166
     167Actions to perform on connecting and reconnecting.
     168
     169=cut
     170
     171sub onConnect {
     172    my $self = shift;
     173    my $conn = shift;
     174    my $jidStr = shift;
     175
     176    my $fullJid = $self->{SESSION}->{FULLJID} || $jidStr;
     177    my $roster = $conn->getRosterFromJID($jidStr);
     178
     179    $roster->fetch();
     180    $self->PresenceSend( priority => 1 );
     181
     182    $conn->renameConnection($jidStr, $fullJid);
     183    BarnOwl::admin_message('Jabber', "Connected to jabber as $fullJid");
     184    # The remove_io_dispatch() method is called from the
     185    # ConnectionManager's removeConnection() method.
     186    $self->{fileno} = $self->getSocket()->fileno();
     187    BarnOwl::add_io_dispatch($self->{fileno}, 'r', sub { $self->OwlProcess($fullJid) });
     188
     189    # populate completion from roster.
     190    for my $buddy ( $roster->jids('all') ) {
     191        my %jq  = $roster->query($buddy);
     192        my $name = $jq{name} || $buddy->GetUserID();
     193        $BarnOwl::Module::Jabber::completion_jids{$name} = 1;
     194        $BarnOwl::Module::Jabber::completion_jids{$buddy->GetJID()} = 1;
     195    }
     196    $BarnOwl::Module::Jabber::vars{idletime} |= BarnOwl::getidletime();
     197    unless (exists $BarnOwl::Module::Jabber::vars{keepAliveTimer}) {
     198        $BarnOwl::Module::Jabber::vars{keepAliveTimer} =
     199            BarnOwl::Timer->new({
     200                'after' => 5,
     201                'interval' => 5,
     202                'cb' => sub { BarnOwl::Module::Jabber::do_keep_alive_and_auto_away(@_) }
     203                                });
     204    }
     205}
     206
    165207=head1 SEE ALSO
    166208
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber/ConnectionManager.pm

    rf1a2736 r2cca044  
    8585    $self->{$jidStr}->{ReconnectAt} = time + $self->{$jidStr}->{ReconnectBackoff};
    8686
    87     my $status = $self->{$jidStr}->{Client}->Connect;
     87    my $client = $self->{$jidStr}->{Client};
     88    my $status = $client->Connect;
    8889    return 0 unless $status;
    8990
    90     my @result = $self->{$jidStr}->{Client}->AuthSend( %{ $self->{$jidStr}->{Auth} } );
     91    my @result = $client->AuthSend( %{ $self->{$jidStr}->{Auth} } );
    9192    if ( !@result || $result[0] ne 'ok' ) {
    9293        $self->removeConnection($jidStr);
     
    9495        return 0;
    9596    }
    96 
    97     BarnOwl::admin_message(Jabber => "Reconnected to jabber as $jidStr");
    98     $self->{$jidStr}{Status} = "available";
    99 
    100     foreach my $muc ($self->{$jidStr}->{Client}->MUCs()) {
     97    $self->{$jidStr}->{Roster} = $client->Roster();
     98    $self->{$jidStr}->{Status} = "available";
     99    $client->onConnect($self, $jidStr);
     100    foreach my $muc ($client->MUCs()) {
    101101        $muc->Join($muc->{ARGS});
    102102    }
  • runtests.sh

    r42ad917 r9f026c1  
    11#!/bin/sh
    2 prove t/ --perl ./perl_tester
     2HARNESS_PERL=./perl_tester exec prove t/
  • tester.c

    re9c6fc8 rf0f2eec  
    223223  owl_filter *f1, *f2, *f3, *f4, *f5;
    224224
    225   owl_list_create(&(g.filterlist));
     225  owl_dict_create(&g.filters);
     226  g.filterlist = NULL;
    226227  owl_message_init(&m);
    227228  owl_message_set_type_zephyr(&m);
  • scripts/do-release

    r01846ce rd771d1b  
    3131if [ ! "$force" ] && [ "$VERS" != "$(head -1 ChangeLog)" ]; then
    3232    die "No ChangeLog entry for version $VERS, aborting."
     33fi
     34
     35head=$(git symbolic-ref HEAD)
     36head=${head#refs/heads/}
     37
     38git rev-parse --verify -q $head >/dev/null 2>&1
     39git rev-parse --verify -q origin/$head >/dev/null 2>&1
     40if [ -n "$(git rev-list $head..origin/$head)" ]; then
     41    die "$head is not up to date. Aborting."
    3342fi
    3443
Note: See TracChangeset for help on using the changeset viewer.