Changeset eab7a4c for perl


Ignore:
Timestamp:
Jan 14, 2008, 12:24:43 AM (13 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
ff13a6f
Parents:
e4db5ae
Message:
Right, _connected doesn't work either. I think I need to refactor this
to not be a subclass...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    re4db5ae reab7a4c  
    1616
    1717use base qw(Net::IRC::Connection Class::Accessor Exporter);
    18 __PACKAGE__->mk_accessors(qw(alias channels _connected _motd));
     18__PACKAGE__->mk_accessors(qw(alias channels owl_connected owl_motd));
    1919our @EXPORT_OK = qw(&is_private);
    2020
     
    2929    $self->alias($alias);
    3030    $self->channels([]);
    31     $self->_motd("");
    32     $self->_connected(0);
     31    $self->owl_motd("");
     32    $self->owl_connected(0);
    3333    bless($self, $class);
    3434
     
    110110sub on_motdstart {
    111111    my ($self, $evt) = @_;
    112     $self->_motd(join "\n", cdr $evt->args);
     112    $self->owl_motd(join "\n", cdr $evt->args);
    113113}
    114114
    115115sub on_motd {
    116116    my ($self, $evt) = @_;
    117     $self->_motd(join "\n", $self->_motd, cdr $evt->args);
     117    $self->owl_motd(join "\n", $self->owl_motd, cdr $evt->args);
    118118}
    119119
    120120sub on_endofmotd {
    121121    my ($self, $evt) = @_;
    122     $self->_motd(join "\n", $self->_motd, cdr $evt->args);
    123     if(!$self->_connected) {
     122    $self->owl_motd(join "\n", $self->owl_motd, cdr $evt->args);
     123    if(!$self->owl_connected) {
    124124        BarnOwl::admin_message("IRC", "Connected to " .
    125125                               $self->server . " (" . $self->alias . ")");
    126         $self->_connected(1);
     126        $self->owl_connected(1);
    127127       
    128128    }
    129129    BarnOwl::admin_message("IRC",
    130130            BarnOwl::Style::boldify('MOTD for ' . $self->alias) . "\n"
    131             . strip_irc_formatting($self->_motd));
     131            . strip_irc_formatting($self->owl_motd));
    132132}
    133133
     
    163163                           "[" . $self->alias . "] " .
    164164                           [$evt->args]->[1] . ": Nick already in use");
     165    unless($self->owl_connected) {
     166        $self->disconnect;
     167    }
    165168}
    166169
Note: See TracChangeset for help on using the changeset viewer.