Changeset eab7a4c for perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
- Timestamp:
- Jan 14, 2008, 12:24:43 AM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- ff13a6f
- Parents:
- e4db5ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
re4db5ae reab7a4c 16 16 17 17 use 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)); 19 19 our @EXPORT_OK = qw(&is_private); 20 20 … … 29 29 $self->alias($alias); 30 30 $self->channels([]); 31 $self-> _motd("");32 $self-> _connected(0);31 $self->owl_motd(""); 32 $self->owl_connected(0); 33 33 bless($self, $class); 34 34 … … 110 110 sub on_motdstart { 111 111 my ($self, $evt) = @_; 112 $self-> _motd(join "\n", cdr $evt->args);112 $self->owl_motd(join "\n", cdr $evt->args); 113 113 } 114 114 115 115 sub on_motd { 116 116 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); 118 118 } 119 119 120 120 sub on_endofmotd { 121 121 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) { 124 124 BarnOwl::admin_message("IRC", "Connected to " . 125 125 $self->server . " (" . $self->alias . ")"); 126 $self-> _connected(1);126 $self->owl_connected(1); 127 127 128 128 } 129 129 BarnOwl::admin_message("IRC", 130 130 BarnOwl::Style::boldify('MOTD for ' . $self->alias) . "\n" 131 . strip_irc_formatting($self-> _motd));131 . strip_irc_formatting($self->owl_motd)); 132 132 } 133 133 … … 163 163 "[" . $self->alias . "] " . 164 164 [$evt->args]->[1] . ": Nick already in use"); 165 unless($self->owl_connected) { 166 $self->disconnect; 167 } 165 168 } 166 169
Note: See TracChangeset
for help on using the changeset viewer.