Fix when moving sip contact from not in contact list group to other group was resulting add and remove events when only move is needed and so two contacts were displayed in contactlist.

cusax-fix
Damian Minkov 18 years ago
parent 155427646e
commit e8d02ae0fe

@ -466,40 +466,11 @@ public void moveContactToGroup(Contact contactToMove,
parentSipGroup.removeContact(sipContact);
// if this is a volatile contact then we haven't really subscribed to
// them so we'd need to do so here
if(!sipContact.isPersistent())
{
//first tell everyone that the volatile contact was removed
fireSubscriptionEvent(sipContact,
parentSipGroup,
SubscriptionEvent.SUBSCRIPTION_REMOVED);
try
{
// simply change the parent of the contact, don't resubscribe
((ContactGroupSipImpl) newParent).addContact(sipContact);
//now tell everyone that we've added the contact
fireSubscriptionEvent(sipContact,
newParent,
SubscriptionEvent.SUBSCRIPTION_CREATED);
}
catch (Exception ex)
{
logger.error("Failed to move contact "
+ sipContact.getAddress()
, ex);
}
}
else
{
((ContactGroupSipImpl) newParent).addContact(sipContact);
((ContactGroupSipImpl) newParent).addContact(sipContact);
fireSubscriptionMovedEvent(contactToMove,
parentSipGroup,
newParent);
}
fireSubscriptionMovedEvent(contactToMove,
parentSipGroup,
newParent);
}
/**

Loading…
Cancel
Save