adium 2266:2ff64a5667c2: Fix a few multiple-containers issues wi...
commits at adium.im
commits at adium.im
Thu May 21 18:43:21 UTC 2009
details: http://hg.adium.im/adium/rev/2ff64a5667c2
revision: 2266:2ff64a5667c2
author: Zachary West <zacw at adium.im>
date: Thu May 21 14:43:10 2009 -0400
Fix a few multiple-containers issues with meta contacts.
Avoid trying to move a contact from a group it doesn't belong in, which was probably causing issues. Fix deleting a meta contact in the contact list, as it should behave like a normal contact (delete in secondary group removes from group, delete from final group deletes it). Refs #11797.
diffstat:
Frameworks/Adium Framework/Source/AIMetaContact.m | 33 ++++++++++------
Plugins/Purple Service/CBPurpleAccount.m | 4 ++
2 files changed, 24 insertions(+), 13 deletions(-)
diffs (59 lines):
diff -r f42f9edb7810 -r 2ff64a5667c2 Frameworks/Adium Framework/Source/AIMetaContact.m
--- a/Frameworks/Adium Framework/Source/AIMetaContact.m Thu May 21 14:13:12 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIMetaContact.m Thu May 21 14:43:10 2009 -0400
@@ -156,21 +156,28 @@
}
- (void)removeFromGroup:(AIListObject <AIContainingObject> *)group
-{
- NSSet *objectsToRemove = nil;
-
- //If the metaContact only has one listContact, we will remove that contact from all accounts
- if (self.uniqueContainedObjectsCount == 1) {
- AIListContact *listContact = [self.uniqueContainedObjects objectAtIndex:0];
-
- objectsToRemove = [adium.contactController allContactsWithService:listContact.service UID:listContact.UID];
- for (AIListContact *contact in objectsToRemove) {
- [contact removeFromGroup:group];
+{
+ if (self.groups.count == 1) {
+ if (self.uniqueContainedObjectsCount == 1) {
+ //If the metaContact only has one listContact, we will remove that contact from all accounts
+ AIListContact *listContact = [self.uniqueContainedObjects objectAtIndex:0];
+
+ NSSet *objectsToRemove = [adium.contactController allContactsWithService:listContact.service UID:listContact.UID];
+ for (AIListContact *contact in objectsToRemove) {
+ [contact removeFromGroup:group];
+ }
+ } else {
+ // Otherwise, we just need to explode the meta.
+ [adium.contactController explodeMetaContact:self];
+ }
+ } else {
+ // Otherwise, remove our contained contacts from this group.
+ for (AIListContact *contact in self) {
+ if ([contact.remoteGroups containsObject:group]) {
+ [contact removeFromGroup:group];
+ }
}
}
-
- //Now break the metaContact down, taking out all contacts and putting them back in the main list
- [adium.contactController explodeMetaContact:self];
}
//A metaContact should never be a stranger
diff -r f42f9edb7810 -r 2ff64a5667c2 Plugins/Purple Service/CBPurpleAccount.m
--- a/Plugins/Purple Service/CBPurpleAccount.m Thu May 21 14:13:12 2009 -0400
+++ b/Plugins/Purple Service/CBPurpleAccount.m Thu May 21 14:43:10 2009 -0400
@@ -660,6 +660,10 @@
//Move the objects to it
for (AIListContact *contact in objects) {
+ if (![contact.remoteGroups intersectsSet:oldGroups] && oldGroups.count) {
+ continue;
+ }
+
NSString *alias = [contact.parentContact preferenceForKey:@"Alias"
group:PREF_GROUP_ALIASES];
More information about the commits
mailing list