diff options
author | Emil Ivov <emcho@jitsi.org> | 2006-09-25 16:38:31 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2006-09-25 16:38:31 +0000 |
commit | dbcda257666552381113d3257a605c2a567dccf4 (patch) | |
tree | a206df521d6d547f6d7f8ac58edb5042f54a6c96 /src | |
parent | 15748a5193002688e3d8381a0059a01c40a6b204 (diff) | |
download | jitsi-dbcda257666552381113d3257a605c2a567dccf4.zip jitsi-dbcda257666552381113d3257a605c2a567dccf4.tar.gz jitsi-dbcda257666552381113d3257a605c2a567dccf4.tar.bz2 |
Remove all children of the proto root before removing the root itself.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java index 4f323b8..8d096d6 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java +++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java @@ -1342,12 +1342,31 @@ public class MetaContactListServiceImpl = (OperationSetPersistentPresence)provider .getOperationSet(OperationSetPersistentPresence.class); + //ignore if persistent presence is not supported. + if(persPresOpSet == null) + return; + ContactGroup rootGroup = persPresOpSet.getServerStoredContactListRoot(); - //remove the group + //iterate all sub groups and remove them one by one + //(we dont simply remove the root group because the mcl storage manager + //is stupid (i wrote it) and doesn't know root groups exist. that's why + //it needs to hear an event for every single group.) + Iterator subgroups = rootGroup.subgroups(); + + while(subgroups.hasNext()) + { + ContactGroup group = (ContactGroup)subgroups.next(); + //remove the group + this.removeContactGroupFromMetaContactGroup( + this.rootMetaGroup, group, provider); + } + + //remove the root group this.removeContactGroupFromMetaContactGroup( this.rootMetaGroup, rootGroup, provider); + } /** |