adium-1.4 3075:311881d88a02: Added debug logging when requesting...

commits at adium.im commits at adium.im
Mon Oct 11 16:49:35 UTC 2010


details:	http://hg.adium.im/adium-1.4/rev/311881d88a02
revision:	3075:311881d88a02
author:		Evan Schoenberg
date:		Mon Oct 11 11:48:50 2010 -0500

Added debug logging when requesting serverside grouping changes
Subject: adium-1.4 3076:f1841622cf0e: More debug logging for group changes

details:	http://hg.adium.im/adium-1.4/rev/f1841622cf0e
revision:	3076:f1841622cf0e
author:		Evan Schoenberg
date:		Mon Oct 11 11:49:04 2010 -0500

More debug logging for group changes
Subject: adium-1.4 3077:5e06c4ce8862: Expanded META_GROUPING_DEBUG and enabled it for now for debug builds

details:	http://hg.adium.im/adium-1.4/rev/5e06c4ce8862
revision:	3077:5e06c4ce8862
author:		Evan Schoenberg
date:		Mon Oct 11 11:49:30 2010 -0500

Expanded META_GROUPING_DEBUG and enabled it for now for debug builds

diffs (88 lines):

diff -r 8054154df20a -r 5e06c4ce8862 Frameworks/Adium Framework/Source/AIMetaContact.m
--- a/Frameworks/Adium Framework/Source/AIMetaContact.m	Mon Oct 11 11:26:43 2010 -0500
+++ b/Frameworks/Adium Framework/Source/AIMetaContact.m	Mon Oct 11 11:49:30 2010 -0500
@@ -30,9 +30,16 @@
 
 #define	OBJECT_STATUS_CACHE			@"Object Status Cache"
 
-/* If META_TYPE_DEBUG is defined, metaContacts and uniqueMetaContacts are given an 
- * identifying suffix to their formattedUID in the contact list */
-//#define META_TYPE_DEBUG TRUE
+#ifdef DEBUG_BUILD
+	/* If META_GROUPING_DEBUG is defined, debug logging becomes much noisier regarding
+	* changes to the group assignments of a metacontact and its contained contacts.
+	*/
+	#define META_GROUPING_DEBUG TRUE
+
+	/* If META_TYPE_DEBUG is defined, metaContacts and uniqueMetaContacts are given an 
+	 * identifying suffix to their formattedUID in the contact list */
+	//#define META_TYPE_DEBUG TRUE
+#endif
 
 @interface AIListContact ()
 @property (readwrite, nonatomic, assign) AIMetaContact *metaContact;
@@ -147,7 +154,16 @@
 			[targetGroups addObject:adium.contactController.offlineGroup];
 		else {
 			for (AIListContact *containedContact in self.uniqueContainedObjects) {
-				[targetGroups unionSet:containedContact.remoteGroups];
+#ifdef META_GROUPING_DEBUG
+				if (![containedContact.remoteGroups isSubsetOfSet:targetGroups]) {
+					/* containedContact is in 1 or more remote groups that we're not yet in. */
+					AILog(@"%@: %@ groups us into %@", self, containedContact, containedContact.remoteGroups);
+					[targetGroups unionSet:containedContact.remoteGroups];
+					
+				}
+#else
+				[targetGroups unionSet:containedContact.remoteGroups];			
+#endif
 			}
 		}
 	} else {
@@ -631,7 +647,7 @@
 - (void)updateRemoteGroupingOfContact:(AIListContact *)inListContact;
 {
 #ifdef META_GROUPING_DEBUG
-	AILog(@"AIMetaContact: Remote grouping of %@ changed to %@",inListObject,inListObject.remoteGroupNames);
+	AILog(@"AIMetaContact: Remote grouping of %@ changed to %@", inListContact, inListContact.remoteGroupNames);
 #endif
 	
 	//When a contact has its remote grouping changed, this may mean it is now listed on an online account.
diff -r 8054154df20a -r 5e06c4ce8862 Plugins/Purple Service/CBPurpleAccount.m
--- a/Plugins/Purple Service/CBPurpleAccount.m	Mon Oct 11 11:26:43 2010 -0500
+++ b/Plugins/Purple Service/CBPurpleAccount.m	Mon Oct 11 11:49:30 2010 -0500
@@ -667,6 +667,7 @@
 
 	//Move the objects to it
 	for (AIListContact *contact in objects) {
+		AILogWithSignature(@"Moving %@ from %@ to %@; we know it's in %@ previously", contact, oldGroups, groups, contact.remoteGroups);
 		if (![contact.remoteGroups intersectsSet:oldGroups] && oldGroups.count) {
 			continue;
 		}
diff -r 8054154df20a -r 5e06c4ce8862 Plugins/Purple Service/SLPurpleCocoaAdapter.m
--- a/Plugins/Purple Service/SLPurpleCocoaAdapter.m	Mon Oct 11 11:26:43 2010 -0500
+++ b/Plugins/Purple Service/SLPurpleCocoaAdapter.m	Mon Oct 11 11:49:30 2010 -0500
@@ -1017,6 +1017,7 @@
 	for (NSString *groupName in groupNames) {
 		if (!oldGroups.count) {
 			// If we don't have any source groups, silently turn this into an add.
+			AILog(@"Move of %@ failed because we have no oldGroups; adding instead", objectUID);
 			[self addUID:objectUID onAccount:adiumAccount toGroup:groupName withAlias:alias];
 			continue;
 		}
@@ -1038,6 +1039,7 @@
 				
 				if ((buddy = purple_find_buddy_in_group(account, [objectUID UTF8String], oldGroup))) {
 					// Perform the add to the new group. This will turn into a move, and will update serverside.
+					AILog(@"Buddy %p (%@) moving serverside to %@", buddy, objectUID, sourceGroupName);
 					purple_blist_add_buddy(buddy, NULL, group, NULL);
 					// Continue so we avoid the "add to group" code below.
 					continue;
@@ -1045,6 +1047,7 @@
 			}
 			
 			// If we got this far, the move failed; turn into an add.
+			AILog(@"Move of %@ failed; adding instead", objectUID);
 			[self addUID:objectUID onAccount:adiumAccount toGroup:groupName withAlias:alias];
 		}
 	}




More information about the commits mailing list