Changeset 31cf416


Ignore:
Timestamp:
Jan 11, 2007, 5:29:21 PM (14 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:
1dfc7df
Parents:
30c735c
git-author:
Nelson Elhage <nelhage@mit.edu> (01/11/07 17:26:44)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/11/07 17:29:21)
Message:
Some stupid Net::Jabber::MUC bugfixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/Net/Jabber/MUC.pm

    r004caa5 r31cf416  
    5555        $jid = Net::Jabber::JID->new($jid) unless UNIVERSAL::isa($jid, 'Net::Jabber::JID');
    5656        $args{jid} = $jid;
    57     } else if($args{room} && $args{server} && $args{nick}) {
     57    } elsif($args{room} && $args{server} && $args{nick}) {
    5858        $args{jid} = New::Jabber::JID->new($args{room}."@".$args{server}."/".$args{nick});
    5959    } else {
     
    166166    my $sid = shift;
    167167    my $packet = shift;
    168    
     168
    169169    $self->_handlePresence($packet) if $packet->GetTag() eq "presence";
    170170}
     
    181181
    182182    my $type = $presence->GetType() || "available";
    183     my $from = $presence->GetFrom();
    184 
    185     return unless $from->GetJid('base') eq $self->BaseJID;
    186 
    187     if($type eq 'available') {
     183    my $from = Net::Jabber::JID->new($presence->GetFrom());
     184
     185    return unless $from->GetJID('base') eq $self->BaseJID;
     186
     187    owl::error('JID matches');
     188
     189    if($type eq 'unavailable') {
    188190        delete $self->{PRESENCE}->{$from->GetJID('full')};
    189     } else {
     191    } elsif($type eq 'available') {
    190192        $self->{PRESENCE}->{$from->GetJID('full')} = $from;
    191193    }
     
    215217sub Presence {
    216218    my $self = shift;
    217     return keys %{$self->{PRESENCE}};
    218 }
     219    return values %{$self->{PRESENCE}};
     220}
     221
     2221;
Note: See TracChangeset for help on using the changeset viewer.