From e8d02ae0fed4e4db2fa53fc62ef8c2b63016306f Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Thu, 19 Jun 2008 14:03:44 +0000 Subject: [PATCH] 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. --- .../sip/OperationSetPresenceSipImpl.java | 37 ++----------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java index 17a0b7e56..3f084d97f 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java @@ -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); } /**