Changeset 72a53e9


Ignore:
Timestamp:
Jan 21, 2007, 6:29:01 PM (14 years ago)
Author:
Alejandro R. Sedeño <asedeno@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:
585bdc3
Parents:
52891b5
Message:
Update to Roster.pm to not blow away presence information for a jid
on every roster update for that jid.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/Net/XMPP/Roster.pm

    rd89b57f r72a53e9  
    270270
    271271    $jid = $jid->GetJID() if UNIVERSAL::isa($jid,"Net::XMPP::JID");
    272 
    273     $self->{JIDS}->{$jid} = \%item;
    274 
     272    if (exists $self->{JIDS}->{$jid})
     273    {
     274        foreach my $key (keys %item)
     275        {
     276            $self->{JIDS}->{$jid}->{$key} = $item{$key};
     277        }
     278    }
     279    else
     280    {
     281        $self->{JIDS}->{$jid} = \%item;
     282
     283    }
    275284    foreach my $group (@{$item{groups}})
    276285    {
    277         $self->{GROUPS}->{$group}->{$jid} = 1;
     286        $self->{GROUPS}->{$group}->{$jid} = 1;
    278287    }
    279288}
     
    440449    foreach my $jid (keys(%{$roster}))
    441450    {
    442         $self->remove($jid);
    443 
    444451        if ($roster->{$jid}->{subscription} ne "remove")
    445452        {
    446453            $self->add($jid, %{$roster->{$jid}});
     454        }
     455        else
     456        {
     457            $self->remove($jid);
    447458        }
    448459    }
Note: See TracChangeset for help on using the changeset viewer.