Index: Makefile.in
===================================================================
--- Makefile.in	(revision c60ade251647a4ea5fe6675372c30ea5a7772244)
+++ Makefile.in	(revision 5ff830a145bf5f2e869a06f9dc2d43f97773d189)
@@ -11,5 +11,5 @@
 CC=@CC@
 LIBS=@LIBS@ -L./libfaim -lfaim
-CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" -DOWL_SVN_REVNO=`./svkversion`
+CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" -DOWL_SVN_REVNO=$(shell ./svkversion)
 LDFLAGS=@LDFLAGS@
 XSUBPPDIR=@XSUBPPDIR@
Index: global.c
===================================================================
--- global.c	(revision c0f9e3009bc03e80a44de64cd5f2b4033290236e)
+++ global.c	(revision eebef194307e93a0e2956946794840c21dd8c4ba)
@@ -480,6 +480,6 @@
 }
 
-void owl_global_update_lastinputtime(owl_global *g) {
-  g->lastinputtime = time(NULL);
+void owl_global_set_lastinputtime(owl_global *g, time_t time) {
+  g->lastinputtime = time;
 }
 
Index: owl.c
===================================================================
--- owl.c	(revision 6fe806ae890b6a1616bd442639d297349a7d8d20)
+++ owl.c	(revision 6fe806ae890b6a1616bd442639d297349a7d8d20)
@@ -587,5 +587,5 @@
       }
       
-      owl_global_update_lastinputtime(&g);
+      owl_global_set_lastinputtime(&g, now);
       /* find and activate the current keymap.
        * TODO: this should really get fixed by activating
Index: perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
===================================================================
--- perl/modules/IRC/lib/BarnOwl/Module/IRC.pm	(revision 56e72d52601116f990fcc6a15f4e71f51adfd238)
+++ perl/modules/IRC/lib/BarnOwl/Module/IRC.pm	(revision 5ff830a145bf5f2e869a06f9dc2d43f97773d189)
@@ -65,5 +65,5 @@
 sub shutdown {
     for my $conn (values %ircnets) {
-        $conn->disconnect();
+        $conn->conn->disconnect();
     }
 }
@@ -162,5 +162,11 @@
        );
 
-    $ircnets{$alias} = $conn;
+    if ($conn->connected) {
+        BarnOwl::admin_message("IRC", "Connected to $alias as $nick");
+        $ircnets{$alias} = $conn;
+    } else {
+        die("IRC::Connection->connect failed: $!");
+    }
+
     return;
 }
@@ -169,5 +175,5 @@
     my $cmd = shift;
     my $conn = get_connection(\@_);
-    $conn->disconnect;
+    $conn->conn->disconnect;
     delete $ircnets{$conn->alias};
 }
@@ -191,5 +197,5 @@
     # Strip whitespace. In the future -- send one message/line?
     $body =~ tr/\n\r/  /;
-    $conn->privmsg($to, $body);
+    $conn->conn->privmsg($to, $body);
     my $msg = BarnOwl::Message->new(
         type        => 'IRC',
@@ -214,5 +220,5 @@
     $channels{$chan} ||= [];
     push @{$channels{$chan}}, $conn;
-    $conn->join($chan);
+    $conn->conn->join($chan);
 }
 
@@ -222,5 +228,5 @@
     my $chan = get_channel(\@_) || die("Usage: $cmd <channel>\n");
     $channels{$chan} = [grep {$_ ne $conn} @{$channels{$chan} || []}];
-    $conn->part($chan);
+    $conn->conn->part($chan);
 }
 
@@ -229,5 +235,5 @@
     my $conn = get_connection(\@_);
     my $nick = shift or die("Usage: $cmd <new nick>\n");
-    $conn->nick($nick);
+    $conn->conn->nick($nick);
 }
 
@@ -236,5 +242,5 @@
     my $conn = get_connection(\@_);
     my $chan = get_channel(\@_) || die("Usage: $cmd <channel>\n");
-    $conn->names($chan);
+    $conn->conn->names($chan);
 }
 
@@ -243,5 +249,5 @@
     my $conn = get_connection(\@_);
     my $who = shift || die("Usage: $cmd <user>\n");
-    $conn->whois($who);
+    $conn->conn->whois($who);
 }
 
@@ -249,5 +255,5 @@
     my $cmd = shift;
     my $conn = get_connection(\@_);
-    $conn->motd;
+    $conn->conn->motd;
 }
 
Index: perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
===================================================================
--- perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm	(revision eab7a4c4530c5e21dfa6a88f13259657fb19949a)
+++ perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm	(revision 5ff830a145bf5f2e869a06f9dc2d43f97773d189)
@@ -10,14 +10,26 @@
 =head1 DESCRIPTION
 
-This module is a Net::IRC::Connection subclass for BarnOwl's IRC
+This module is a wrapper around Net::IRC::Connection for BarnOwl's IRC
 support
 
 =cut
 
-use base qw(Net::IRC::Connection Class::Accessor Exporter);
-__PACKAGE__->mk_accessors(qw(alias channels owl_connected owl_motd));
+use Net::IRC::Connection;
+
+use base qw(Class::Accessor Exporter);
+__PACKAGE__->mk_accessors(qw(conn alias channels connected motd));
 our @EXPORT_OK = qw(&is_private);
 
 use BarnOwl;
+
+BEGIN {
+    no strict 'refs';
+    my @delegate = qw(nick server);
+    for my $meth (@delegate) {
+        *{"BarnOwl::Module::IRC::Connection::$meth"} = sub {
+            shift->conn->$meth(@_);
+        }
+    }
+};
 
 sub new {
@@ -26,28 +38,31 @@
     my $alias = shift;
     my %args = (@_);
-    my $self = $class->SUPER::new($irc, %args);
+    my $conn = Net::IRC::Connection->new($irc, %args);
+    my $self = bless({}, $class);
+    $self->conn($conn);
     $self->alias($alias);
     $self->channels([]);
-    $self->owl_motd("");
-    $self->owl_connected(0);
-    bless($self, $class);
-
-    $self->add_default_handler(sub { goto &on_event; });
-    $self->add_handler(['msg', 'notice', 'public', 'caction'],
-            sub { goto &on_msg });
-    $self->add_handler(['welcome', 'yourhost', 'created',
-            'luserclient', 'luserop', 'luserchannels', 'luserme'],
-            sub { goto &on_admin_msg });
-    $self->add_handler(['myinfo', 'map', 'n_local', 'n_global',
+    $self->motd("");
+    $self->connected(0);
+
+    $self->conn->add_handler(376 => sub { shift; $self->on_connect(@_) });
+    $self->conn->add_default_handler(sub { shift; $self->on_event(@_) });
+    $self->conn->add_handler(['msg', 'notice', 'public', 'caction'],
+            sub { shift; $self->on_msg(@_) });
+    $self->conn->add_handler(['welcome', 'yourhost', 'created',
+            'luserclient', 'luserop', 'luserchannels', 'luserme',
+            'notice', 'error'],
+            sub { shift; $self->on_admin_msg(@_) });
+    $self->conn->add_handler(['myinfo', 'map', 'n_local', 'n_global',
             'luserconns'],
             sub { });
-    $self->add_handler(motdstart => sub { goto &on_motdstart });
-    $self->add_handler(motd      => sub { goto &on_motd });
-    $self->add_handler(endofmotd => sub { goto &on_endofmotd });
-    $self->add_handler(join      => sub { goto &on_join });
-    $self->add_handler(part      => sub { goto &on_part });
-    $self->add_handler(disconnect => sub { goto &on_disconnect });
-    $self->add_handler(nicknameinuse => sub { goto &on_nickinuse });
-    $self->add_handler(cping     => sub { goto &on_ping });
+    $self->conn->add_handler(motdstart => sub { shift; $self->on_motdstart(@_) });
+    $self->conn->add_handler(motd      => sub { shift; $self->on_motd(@_) });
+    $self->conn->add_handler(endofmotd => sub { shift; $self->on_endofmotd(@_) });
+    $self->conn->add_handler(join      => sub { shift; $self->on_join(@_) });
+    $self->conn->add_handler(part      => sub { shift; $self->on_part(@_) });
+    $self->conn->add_handler(disconnect => sub { shift; $self->on_disconnect(@_) });
+    $self->conn->add_handler(nicknameinuse => sub { shift; $self->on_nickinuse(@_) });
+    $self->conn->add_handler(cping     => sub { shift; $self->on_ping(@_) });
 
     return $self;
@@ -97,5 +112,5 @@
 sub on_ping {
     my ($self, $evt) = @_;
-    $self->ctcp_reply($evt->nick, join (' ', ($evt->args)));
+    $self->conn->ctcp_reply($evt->nick, join (' ', ($evt->args)));
 }
 
@@ -110,24 +125,24 @@
 sub on_motdstart {
     my ($self, $evt) = @_;
-    $self->owl_motd(join "\n", cdr $evt->args);
+    $self->motd(join "\n", cdr $evt->args);
 }
 
 sub on_motd {
     my ($self, $evt) = @_;
-    $self->owl_motd(join "\n", $self->owl_motd, cdr $evt->args);
+    $self->motd(join "\n", $self->motd, cdr $evt->args);
 }
 
 sub on_endofmotd {
     my ($self, $evt) = @_;
-    $self->owl_motd(join "\n", $self->owl_motd, cdr $evt->args);
-    if(!$self->owl_connected) {
+    $self->motd(join "\n", $self->motd, cdr $evt->args);
+    if(!$self->connected) {
         BarnOwl::admin_message("IRC", "Connected to " .
                                $self->server . " (" . $self->alias . ")");
-        $self->owl_connected(1);
+        $self->connected(1);
         
     }
     BarnOwl::admin_message("IRC",
             BarnOwl::Style::boldify('MOTD for ' . $self->alias) . "\n"
-            . strip_irc_formatting($self->owl_motd));
+            . strip_irc_formatting($self->motd));
 }
 
@@ -163,6 +178,6 @@
                            "[" . $self->alias . "] " .
                            [$evt->args]->[1] . ": Nick already in use");
-    unless($self->owl_connected) {
-        $self->disconnect;
+    unless($self->connected) {
+        $self->conn->disconnect;
     }
 }
Index: perlwrap.pm
===================================================================
--- perlwrap.pm	(revision f2d72128d54fe0a3466422505e2ae01e3b137498)
+++ perlwrap.pm	(revision 5ff830a145bf5f2e869a06f9dc2d43f97773d189)
@@ -847,5 +847,5 @@
 #    return format_zephyr($m);
 #  }
-  if ( $m->is_login ) {
+  if ( $m->is_loginout ) {
     return format_login($m);
   }
Index: zephyr.c
===================================================================
--- zephyr.c	(revision 60c2e1efd8372f99fd923f856eea1e9cc79d63aa)
+++ zephyr.c	(revision 10e396337dd6bf954d7f0d8ef97faf81999c7db3)
@@ -613,13 +613,16 @@
       tmp = short_zuser(retnotice->z_recipient);
       owl_function_error("%s: Not logged in or subscribing.", tmp);
-      snprintf(buff, BUFFLEN, "Could not send message to %s: not logged in or subscribing to", tmp);
       if(strcmp(retnotice->z_class, "message")) {
         snprintf(buff, BUFFLEN,
-                 "%s class %s, instance %s.\n", buff,
+                 "Could not send message to %s: "
+                 "not logged in or subscribing to class %s, instance %s.\n", 
+                 tmp,
                  retnotice->z_class,
                  retnotice->z_class_inst);
       } else {
         snprintf(buff, BUFFLEN,
-                 "%s messages.\n", buff);
+                 "Could not send message to %s: "
+                 "not logged in or subscribing to messages.\n",
+                 tmp);
       }
       owl_function_adminmsg("", buff);
