Changes in / [6fe806a:625802a]
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
rc60ade2 r5ff830a 11 11 CC=@CC@ 12 12 LIBS=@LIBS@ -L./libfaim -lfaim 13 CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" -DOWL_SVN_REVNO= `./svkversion`13 CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" -DOWL_SVN_REVNO=$(shell ./svkversion) 14 14 LDFLAGS=@LDFLAGS@ 15 15 XSUBPPDIR=@XSUBPPDIR@ -
global.c
rc0f9e30 reebef19 480 480 } 481 481 482 void owl_global_ update_lastinputtime(owl_global *g) {483 g->lastinputtime = time (NULL);482 void owl_global_set_lastinputtime(owl_global *g, time_t time) { 483 g->lastinputtime = time; 484 484 } 485 485 -
owl.c
r6fe806a r6fe806a 587 587 } 588 588 589 owl_global_ update_lastinputtime(&g);589 owl_global_set_lastinputtime(&g, now); 590 590 /* find and activate the current keymap. 591 591 * TODO: this should really get fixed by activating -
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
r56e72d5 r5ff830a 65 65 sub shutdown { 66 66 for my $conn (values %ircnets) { 67 $conn-> disconnect();67 $conn->conn->disconnect(); 68 68 } 69 69 } … … 162 162 ); 163 163 164 $ircnets{$alias} = $conn; 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 165 171 return; 166 172 } … … 169 175 my $cmd = shift; 170 176 my $conn = get_connection(\@_); 171 $conn-> disconnect;177 $conn->conn->disconnect; 172 178 delete $ircnets{$conn->alias}; 173 179 } … … 191 197 # Strip whitespace. In the future -- send one message/line? 192 198 $body =~ tr/\n\r/ /; 193 $conn-> privmsg($to, $body);199 $conn->conn->privmsg($to, $body); 194 200 my $msg = BarnOwl::Message->new( 195 201 type => 'IRC', … … 214 220 $channels{$chan} ||= []; 215 221 push @{$channels{$chan}}, $conn; 216 $conn-> join($chan);222 $conn->conn->join($chan); 217 223 } 218 224 … … 222 228 my $chan = get_channel(\@_) || die("Usage: $cmd <channel>\n"); 223 229 $channels{$chan} = [grep {$_ ne $conn} @{$channels{$chan} || []}]; 224 $conn-> part($chan);230 $conn->conn->part($chan); 225 231 } 226 232 … … 229 235 my $conn = get_connection(\@_); 230 236 my $nick = shift or die("Usage: $cmd <new nick>\n"); 231 $conn-> nick($nick);237 $conn->conn->nick($nick); 232 238 } 233 239 … … 236 242 my $conn = get_connection(\@_); 237 243 my $chan = get_channel(\@_) || die("Usage: $cmd <channel>\n"); 238 $conn-> names($chan);244 $conn->conn->names($chan); 239 245 } 240 246 … … 243 249 my $conn = get_connection(\@_); 244 250 my $who = shift || die("Usage: $cmd <user>\n"); 245 $conn-> whois($who);251 $conn->conn->whois($who); 246 252 } 247 253 … … 249 255 my $cmd = shift; 250 256 my $conn = get_connection(\@_); 251 $conn-> motd;257 $conn->conn->motd; 252 258 } 253 259 -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
reab7a4c r5ff830a 10 10 =head1 DESCRIPTION 11 11 12 This module is a Net::IRC::Connection subclassfor BarnOwl's IRC12 This module is a wrapper around Net::IRC::Connection for BarnOwl's IRC 13 13 support 14 14 15 15 =cut 16 16 17 use base qw(Net::IRC::Connection Class::Accessor Exporter); 18 __PACKAGE__->mk_accessors(qw(alias channels owl_connected owl_motd)); 17 use Net::IRC::Connection; 18 19 use base qw(Class::Accessor Exporter); 20 __PACKAGE__->mk_accessors(qw(conn alias channels connected motd)); 19 21 our @EXPORT_OK = qw(&is_private); 20 22 21 23 use 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 }; 22 34 23 35 sub new { … … 26 38 my $alias = shift; 27 39 my %args = (@_); 28 my $self = $class->SUPER::new($irc, %args); 40 my $conn = Net::IRC::Connection->new($irc, %args); 41 my $self = bless({}, $class); 42 $self->conn($conn); 29 43 $self->alias($alias); 30 44 $self->channels([]); 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', 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', 42 57 'luserconns'], 43 58 sub { }); 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});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(@_) }); 52 67 53 68 return $self; … … 97 112 sub on_ping { 98 113 my ($self, $evt) = @_; 99 $self->c tcp_reply($evt->nick, join (' ', ($evt->args)));114 $self->conn->ctcp_reply($evt->nick, join (' ', ($evt->args))); 100 115 } 101 116 … … 110 125 sub on_motdstart { 111 126 my ($self, $evt) = @_; 112 $self-> owl_motd(join "\n", cdr $evt->args);127 $self->motd(join "\n", cdr $evt->args); 113 128 } 114 129 115 130 sub on_motd { 116 131 my ($self, $evt) = @_; 117 $self-> owl_motd(join "\n", $self->owl_motd, cdr $evt->args);132 $self->motd(join "\n", $self->motd, cdr $evt->args); 118 133 } 119 134 120 135 sub on_endofmotd { 121 136 my ($self, $evt) = @_; 122 $self-> owl_motd(join "\n", $self->owl_motd, cdr $evt->args);123 if(!$self-> owl_connected) {137 $self->motd(join "\n", $self->motd, cdr $evt->args); 138 if(!$self->connected) { 124 139 BarnOwl::admin_message("IRC", "Connected to " . 125 140 $self->server . " (" . $self->alias . ")"); 126 $self-> owl_connected(1);141 $self->connected(1); 127 142 128 143 } 129 144 BarnOwl::admin_message("IRC", 130 145 BarnOwl::Style::boldify('MOTD for ' . $self->alias) . "\n" 131 . strip_irc_formatting($self-> owl_motd));146 . strip_irc_formatting($self->motd)); 132 147 } 133 148 … … 163 178 "[" . $self->alias . "] " . 164 179 [$evt->args]->[1] . ": Nick already in use"); 165 unless($self-> owl_connected) {166 $self-> disconnect;180 unless($self->connected) { 181 $self->conn->disconnect; 167 182 } 168 183 } -
perlwrap.pm
rf2d72128 r5ff830a 847 847 # return format_zephyr($m); 848 848 # } 849 if ( $m->is_login ) {849 if ( $m->is_loginout ) { 850 850 return format_login($m); 851 851 } -
zephyr.c
r60c2e1e r10e3963 613 613 tmp = short_zuser(retnotice->z_recipient); 614 614 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);616 615 if(strcmp(retnotice->z_class, "message")) { 617 616 snprintf(buff, BUFFLEN, 618 "%s class %s, instance %s.\n", buff, 617 "Could not send message to %s: " 618 "not logged in or subscribing to class %s, instance %s.\n", 619 tmp, 619 620 retnotice->z_class, 620 621 retnotice->z_class_inst); 621 622 } else { 622 623 snprintf(buff, BUFFLEN, 623 "%s messages.\n", buff); 624 "Could not send message to %s: " 625 "not logged in or subscribing to messages.\n", 626 tmp); 624 627 } 625 628 owl_function_adminmsg("", buff);
Note: See TracChangeset
for help on using the changeset viewer.