Adium

Changeset 24074

Show
Ignore:
Timestamp:
06/26/2008 09:11:37 PM (5 months ago)
Author:
evands
Message:

When given a set of contacts to group into a metacontact, prefer using a passed metacontact if there is one over finding a metacontact which contains a passed contact. This means that dragging a contact from one metacontact into another will now properly move that contact into the new metacontact. Fixes #10188

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/AIContactController.m

    r24013 r24074  
    10291029        AIListContact   *listContact; 
    10301030        AIMetaContact   *metaContact = nil; 
    1031          
    1032         //Look for an existing MetaContact we can use.  The first one we find is the lucky winner. 
     1031 
     1032        //Look for a metacontact we were passed directly 
    10331033        enumerator = [contactsToGroupArray objectEnumerator]; 
    10341034        while (!metaContact && (listContact = [enumerator nextObject])) { 
    10351035                if ([listContact isKindOfClass:[AIMetaContact class]]) { 
    10361036                        metaContact = (AIMetaContact *)listContact; 
    1037                 } else { 
    1038                         metaContact = [contactToMetaContactLookupDict objectForKey:[listContact internalObjectID]]; 
    1039                 } 
    1040         } 
    1041          
     1037                } 
     1038        } 
     1039 
     1040        //If we weren't passed a metacontact, look for an existing metacontact associated with a passed contact 
     1041        if (!metaContact) { 
     1042                enumerator = [contactsToGroupArray objectEnumerator]; 
     1043                while (!metaContact && (listContact = [enumerator nextObject])) { 
     1044                        if (![listContact isKindOfClass:[AIMetaContact class]]) { 
     1045                                metaContact = [contactToMetaContactLookupDict objectForKey:[listContact internalObjectID]]; 
     1046                        } 
     1047                } 
     1048        } 
     1049 
    10421050        //Create a new metaContact is we didn't find one. 
    10431051        if (!metaContact) {