diff options
author | Damian Minkov <damencho@jitsi.org> | 2012-01-09 10:01:10 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2012-01-09 10:01:10 +0000 |
commit | dfcd34f29b91481416f4af4d49b9dc540dd1d3b6 (patch) | |
tree | 54aae707e37388cea053f36ad88312f6370fea64 /src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTransferHandler.java | |
parent | 35aec78296289dde643f0b8e82d1bbf1949ced15 (diff) | |
download | jitsi-dfcd34f29b91481416f4af4d49b9dc540dd1d3b6.zip jitsi-dfcd34f29b91481416f4af4d49b9dc540dd1d3b6.tar.gz jitsi-dfcd34f29b91481416f4af4d49b9dc540dd1d3b6.tar.bz2 |
Adds option to disable dnd contact merging.
Diffstat (limited to 'src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTransferHandler.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTransferHandler.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTransferHandler.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTransferHandler.java index 198c2bb..04d2887 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTransferHandler.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTransferHandler.java @@ -201,9 +201,31 @@ public class ContactListTransferHandler if (transferredContact != destContact) { - MetaContactListManager.moveMetaContactToMetaContact( - (MetaContact) transferredContact.getDescriptor(), - (MetaContact) destContact.getDescriptor()); + String mergeEnabledStr = + GuiActivator.getResources().getSettingsString( + "impl.gui.dnd.MERGE_ENABLED"); + + // by default merging contacts is enabled + if(mergeEnabledStr != null + && !Boolean.parseBoolean(mergeEnabledStr)) + { + UIGroup destGroup = + destContact.getParentGroup(); + + if (destGroup == null + || !(destGroup instanceof MetaUIGroup)) + return false; + + MetaContactListManager.moveMetaContactToGroup( + (MetaContact) transferredContact.getDescriptor(), + (MetaContactGroup) destGroup.getDescriptor()); + } + else + { + MetaContactListManager.moveMetaContactToMetaContact( + (MetaContact) transferredContact.getDescriptor(), + (MetaContact) destContact.getDescriptor()); + } } return true; } |