adium 2333:0214395c374b: Fix dragging *from* a meta contact *int...

commits at adium.im commits at adium.im
Tue May 26 02:07:11 UTC 2009


details:	http://hg.adium.im/adium/rev/0214395c374b
revision:	2333:0214395c374b
author:		Zachary West <zacw at adium.im>
date:		Mon May 25 22:07:05 2009 -0400

Fix dragging *from* a meta contact *into* a group. The containing object for a proxy was its meta, which was causing worlds of trouble on the move. Refs #11962, in that the problem was highlighted there.

diffstat:

 Source/AIListController.m |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r c0caa839631b -r 0214395c374b Source/AIListController.m
--- a/Source/AIListController.m	Mon May 25 21:46:14 2009 -0400
+++ b/Source/AIListController.m	Mon May 25 22:07:05 2009 -0400
@@ -714,10 +714,23 @@
 					// if the group isn't containing -this- proxy.
 					if (!([group containsObject:listObject] && proxyObject.containingObject == group)) {
 						if([listObject isKindOfClass:[AIListContact class]]) {
+							NSSet *sourceGroups = nil;
+							
+							if ([NSEvent optionKey]) {
+								sourceGroups = [NSSet set];
+							} else {
+								if ([proxyObject.containingObject isKindOfClass:[AIMetaContact class]]) {
+									// If we're dragging -from- a meta contact, just do an add; the move performs the removal from the meta.
+									sourceGroups = [NSSet set];
+								} else {
+									sourceGroups = [NSSet setWithObject:proxyObject.containingObject];
+								}
+							}
+
 							// Contact being moved to a new group.
 							// Holding option copies into the new group (like in Finder)
 							[adium.contactController moveContact:(AIListContact *)listObject
-													  fromGroups:([NSEvent optionKey] ? [NSSet set] : [NSSet setWithObject:proxyObject.containingObject])
+													  fromGroups:sourceGroups
 													  intoGroups:[NSSet setWithObject:group]];
 
 						} else if ([listObject isKindOfClass:[AIListGroup class]]) {							




More information about the commits mailing list