| 1 | package Net::YMSG::ChatRoomLogon; | ||
| 2 | use base 'Net::YMSG::Event'; | ||
| 3 | |||
| 4 | sub source | ||
| 5 | { | ||
| 6 | my $self = shift; | ||
| 7 | if (@_) { | ||
| 8 | $self->{source} = shift; | ||
| 9 | my $code = $self->_get_by_name('STATUS_CODE') || 0; | ||
| 10 | if ($code == 99) { | ||
| 11 | require Net::YMSG::NullEvent; | ||
| 12 | bless $self, 'Net::YMSG::NullEvent'; | ||
| 13 | } | ||
| 14 | } | ||
| 15 | $self->{source}; | ||
| 16 | } | ||
| 17 | |||
| 18 | sub from | ||
| 19 | { | ||
| 20 | my $self = shift; | ||
| 21 | $self->_set_by_name('CHATFROM', shift) if @_; | ||
| 22 | if ($self->_get_by_name('ERROR_MESSAGE')) { | ||
| 23 | return 'system'; | ||
| 24 | } | ||
| 25 | $self->_get_by_name('CHATFROM'); | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; | ||
| 29 | __END__ |