Changes in / [625802a:6fe806a]


Ignore:
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Makefile.in

    r5ff830a rc60ade2  
    1111CC=@CC@
    1212LIBS=@LIBS@ -L./libfaim -lfaim
    13 CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" -DOWL_SVN_REVNO=$(shell ./svkversion)
     13CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" -DOWL_SVN_REVNO=`./svkversion`
    1414LDFLAGS=@LDFLAGS@
    1515XSUBPPDIR=@XSUBPPDIR@
  • global.c

    reebef19 rc0f9e30  
    480480}
    481481
    482 void owl_global_set_lastinputtime(owl_global *g, time_t time) {
    483   g->lastinputtime = time;
     482void owl_global_update_lastinputtime(owl_global *g) {
     483  g->lastinputtime = time(NULL);
    484484}
    485485
  • owl.c

    r6fe806a r6fe806a  
    587587      }
    588588     
    589       owl_global_set_lastinputtime(&g, now);
     589      owl_global_update_lastinputtime(&g);
    590590      /* find and activate the current keymap.
    591591       * TODO: this should really get fixed by activating
  • perl/modules/IRC/lib/BarnOwl/Module/IRC.pm

    r5ff830a r56e72d5  
    6565sub shutdown {
    6666    for my $conn (values %ircnets) {
    67         $conn->conn->disconnect();
     67        $conn->disconnect();
    6868    }
    6969}
     
    162162       );
    163163
    164     if ($conn->connected) {
    165         BarnOwl::admin_message("IRC", "Connected to $alias as $nick");
    166         $ircnets{$alias} = $conn;
    167     } else {
    168         die("IRC::Connection->connect failed: $!");
    169     }
    170 
     164    $ircnets{$alias} = $conn;
    171165    return;
    172166}
     
    175169    my $cmd = shift;
    176170    my $conn = get_connection(\@_);
    177     $conn->conn->disconnect;
     171    $conn->disconnect;
    178172    delete $ircnets{$conn->alias};
    179173}
     
    197191    # Strip whitespace. In the future -- send one message/line?
    198192    $body =~ tr/\n\r/  /;
    199     $conn->conn->privmsg($to, $body);
     193    $conn->privmsg($to, $body);
    200194    my $msg = BarnOwl::Message->new(
    201195        type        => 'IRC',
     
    220214    $channels{$chan} ||= [];
    221215    push @{$channels{$chan}}, $conn;
    222     $conn->conn->join($chan);
     216    $conn->join($chan);
    223217}
    224218
     
    228222    my $chan = get_channel(\@_) || die("Usage: $cmd <channel>\n");
    229223    $channels{$chan} = [grep {$_ ne $conn} @{$channels{$chan} || []}];
    230     $conn->conn->part($chan);
     224    $conn->part($chan);
    231225}
    232226
     
    235229    my $conn = get_connection(\@_);
    236230    my $nick = shift or die("Usage: $cmd <new nick>\n");
    237     $conn->conn->nick($nick);
     231    $conn->nick($nick);
    238232}
    239233
     
    242236    my $conn = get_connection(\@_);
    243237    my $chan = get_channel(\@_) || die("Usage: $cmd <channel>\n");
    244     $conn->conn->names($chan);
     238    $conn->names($chan);
    245239}
    246240
     
    249243    my $conn = get_connection(\@_);
    250244    my $who = shift || die("Usage: $cmd <user>\n");
    251     $conn->conn->whois($who);
     245    $conn->whois($who);
    252246}
    253247
     
    255249    my $cmd = shift;
    256250    my $conn = get_connection(\@_);
    257     $conn->conn->motd;
     251    $conn->motd;
    258252}
    259253
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r5ff830a reab7a4c  
    1010=head1 DESCRIPTION
    1111
    12 This module is a wrapper around Net::IRC::Connection for BarnOwl's IRC
     12This module is a Net::IRC::Connection subclass for BarnOwl's IRC
    1313support
    1414
    1515=cut
    1616
    17 use Net::IRC::Connection;
    18 
    19 use base qw(Class::Accessor Exporter);
    20 __PACKAGE__->mk_accessors(qw(conn alias channels connected motd));
     17use base qw(Net::IRC::Connection Class::Accessor Exporter);
     18__PACKAGE__->mk_accessors(qw(alias channels owl_connected owl_motd));
    2119our @EXPORT_OK = qw(&is_private);
    2220
    2321use BarnOwl;
    24 
    25 BEGIN {
    26     no strict 'refs';
    27     my @delegate = qw(nick server);
    28     for my $meth (@delegate) {
    29         *{"BarnOwl::Module::IRC::Connection::$meth"} = sub {
    30             shift->conn->$meth(@_);
    31         }
    32     }
    33 };
    3422
    3523sub new {
     
    3826    my $alias = shift;
    3927    my %args = (@_);
    40     my $conn = Net::IRC::Connection->new($irc, %args);
    41     my $self = bless({}, $class);
    42     $self->conn($conn);
     28    my $self = $class->SUPER::new($irc, %args);
    4329    $self->alias($alias);
    4430    $self->channels([]);
    45     $self->motd("");
    46     $self->connected(0);
    47 
    48     $self->conn->add_handler(376 => sub { shift; $self->on_connect(@_) });
    49     $self->conn->add_default_handler(sub { shift; $self->on_event(@_) });
    50     $self->conn->add_handler(['msg', 'notice', 'public', 'caction'],
    51             sub { shift; $self->on_msg(@_) });
    52     $self->conn->add_handler(['welcome', 'yourhost', 'created',
    53             'luserclient', 'luserop', 'luserchannels', 'luserme',
    54             'notice', 'error'],
    55             sub { shift; $self->on_admin_msg(@_) });
    56     $self->conn->add_handler(['myinfo', 'map', 'n_local', 'n_global',
     31    $self->owl_motd("");
     32    $self->owl_connected(0);
     33    bless($self, $class);
     34
     35    $self->add_default_handler(sub { goto &on_event; });
     36    $self->add_handler(['msg', 'notice', 'public', 'caction'],
     37            sub { goto &on_msg });
     38    $self->add_handler(['welcome', 'yourhost', 'created',
     39            'luserclient', 'luserop', 'luserchannels', 'luserme'],
     40            sub { goto &on_admin_msg });
     41    $self->add_handler(['myinfo', 'map', 'n_local', 'n_global',
    5742            'luserconns'],
    5843            sub { });
    59     $self->conn->add_handler(motdstart => sub { shift; $self->on_motdstart(@_) });
    60     $self->conn->add_handler(motd      => sub { shift; $self->on_motd(@_) });
    61     $self->conn->add_handler(endofmotd => sub { shift; $self->on_endofmotd(@_) });
    62     $self->conn->add_handler(join      => sub { shift; $self->on_join(@_) });
    63     $self->conn->add_handler(part      => sub { shift; $self->on_part(@_) });
    64     $self->conn->add_handler(disconnect => sub { shift; $self->on_disconnect(@_) });
    65     $self->conn->add_handler(nicknameinuse => sub { shift; $self->on_nickinuse(@_) });
    66     $self->conn->add_handler(cping     => sub { shift; $self->on_ping(@_) });
     44    $self->add_handler(motdstart => sub { goto &on_motdstart });
     45    $self->add_handler(motd      => sub { goto &on_motd });
     46    $self->add_handler(endofmotd => sub { goto &on_endofmotd });
     47    $self->add_handler(join      => sub { goto &on_join });
     48    $self->add_handler(part      => sub { goto &on_part });
     49    $self->add_handler(disconnect => sub { goto &on_disconnect });
     50    $self->add_handler(nicknameinuse => sub { goto &on_nickinuse });
     51    $self->add_handler(cping     => sub { goto &on_ping });
    6752
    6853    return $self;
     
    11297sub on_ping {
    11398    my ($self, $evt) = @_;
    114     $self->conn->ctcp_reply($evt->nick, join (' ', ($evt->args)));
     99    $self->ctcp_reply($evt->nick, join (' ', ($evt->args)));
    115100}
    116101
     
    125110sub on_motdstart {
    126111    my ($self, $evt) = @_;
    127     $self->motd(join "\n", cdr $evt->args);
     112    $self->owl_motd(join "\n", cdr $evt->args);
    128113}
    129114
    130115sub on_motd {
    131116    my ($self, $evt) = @_;
    132     $self->motd(join "\n", $self->motd, cdr $evt->args);
     117    $self->owl_motd(join "\n", $self->owl_motd, cdr $evt->args);
    133118}
    134119
    135120sub on_endofmotd {
    136121    my ($self, $evt) = @_;
    137     $self->motd(join "\n", $self->motd, cdr $evt->args);
    138     if(!$self->connected) {
     122    $self->owl_motd(join "\n", $self->owl_motd, cdr $evt->args);
     123    if(!$self->owl_connected) {
    139124        BarnOwl::admin_message("IRC", "Connected to " .
    140125                               $self->server . " (" . $self->alias . ")");
    141         $self->connected(1);
     126        $self->owl_connected(1);
    142127       
    143128    }
    144129    BarnOwl::admin_message("IRC",
    145130            BarnOwl::Style::boldify('MOTD for ' . $self->alias) . "\n"
    146             . strip_irc_formatting($self->motd));
     131            . strip_irc_formatting($self->owl_motd));
    147132}
    148133
     
    178163                           "[" . $self->alias . "] " .
    179164                           [$evt->args]->[1] . ": Nick already in use");
    180     unless($self->connected) {
    181         $self->conn->disconnect;
     165    unless($self->owl_connected) {
     166        $self->disconnect;
    182167    }
    183168}
  • perlwrap.pm

    r5ff830a rf2d72128  
    847847#    return format_zephyr($m);
    848848#  }
    849   if ( $m->is_loginout ) {
     849  if ( $m->is_login ) {
    850850    return format_login($m);
    851851  }
  • zephyr.c

    r10e3963 r60c2e1e  
    613613      tmp = short_zuser(retnotice->z_recipient);
    614614      owl_function_error("%s: Not logged in or subscribing.", tmp);
     615      snprintf(buff, BUFFLEN, "Could not send message to %s: not logged in or subscribing to", tmp);
    615616      if(strcmp(retnotice->z_class, "message")) {
    616617        snprintf(buff, BUFFLEN,
    617                  "Could not send message to %s: "
    618                  "not logged in or subscribing to class %s, instance %s.\n",
    619                  tmp,
     618                 "%s class %s, instance %s.\n", buff,
    620619                 retnotice->z_class,
    621620                 retnotice->z_class_inst);
    622621      } else {
    623622        snprintf(buff, BUFFLEN,
    624                  "Could not send message to %s: "
    625                  "not logged in or subscribing to messages.\n",
    626                  tmp);
     623                 "%s messages.\n", buff);
    627624      }
    628625      owl_function_adminmsg("", buff);
Note: See TracChangeset for help on using the changeset viewer.