| | 655 | } else if ([item isMemberOfClass:[AIMetaContact class]]) { |
|---|
| | 656 | //Ordering gets implemented here. |
|---|
| | 657 | NSString *availableType = [[info draggingPasteboard] availableTypeFromArray:[NSArray arrayWithObject:@"AIListObject"]]; |
|---|
| | 658 | |
|---|
| | 659 | //No longer in a drag, so allow tooltips again |
|---|
| | 660 | if ([availableType isEqualToString:@"AIListObject"]) { |
|---|
| | 661 | |
|---|
| | 662 | //If we don't have drag items, we are dragging from another instance; build our own dragItems array |
|---|
| | 663 | //using the supplied internalObjectIDs |
|---|
| | 664 | if (!dragItems) { |
|---|
| | 665 | if ([[[info draggingPasteboard] availableTypeFromArray:[NSArray arrayWithObject:@"AIListObjectUniqueIDs"]] isEqualToString:@"AIListObjectUniqueIDs"]) { |
|---|
| | 666 | NSArray *dragItemsUniqueIDs; |
|---|
| | 667 | NSMutableArray *arrayOfDragItems; |
|---|
| | 668 | NSString *uniqueID; |
|---|
| | 669 | NSEnumerator *enumerator; |
|---|
| | 670 | |
|---|
| | 671 | dragItemsUniqueIDs = [draggingPasteboard propertyListForType:@"AIListObjectUniqueIDs"]; |
|---|
| | 672 | arrayOfDragItems = [NSMutableArray array]; |
|---|
| | 673 | |
|---|
| | 674 | enumerator = [dragItemsUniqueIDs objectEnumerator]; |
|---|
| | 675 | while ((uniqueID = [enumerator nextObject])) { |
|---|
| | 676 | [arrayOfDragItems addObject:[[adium contactController] existingListObjectWithUniqueID:uniqueID]]; |
|---|
| | 677 | } |
|---|
| | 678 | |
|---|
| | 679 | //We will release this when the drag is completed |
|---|
| | 680 | dragItems = [arrayOfDragItems retain]; |
|---|
| | 681 | } |
|---|
| | 682 | } |
|---|
| | 683 | |
|---|
| | 684 | //The tree root is not associated with our root contact list group, so we need to make that association here |
|---|
| | 685 | if (item == nil) item = contactList; |
|---|
| | 686 | |
|---|
| | 687 | //Move the list object to its new location |
|---|
| | 688 | if ([item isKindOfClass:[AIMetaContact class]]) { |
|---|
| | 689 | |
|---|
| | 690 | NSMutableArray *realDragItems = [NSMutableArray array]; |
|---|
| | 691 | NSEnumerator *enumerator; |
|---|
| | 692 | AIListObject *aDragItem; |
|---|
| | 693 | |
|---|
| | 694 | enumerator = [dragItems objectEnumerator]; |
|---|
| | 695 | while ((aDragItem = [enumerator nextObject])) { |
|---|
| | 696 | if ([aDragItem isMemberOfClass:[AIListContact class]]) { |
|---|
| | 697 | //For listContacts, add all contacts with the same service and UID (on all accounts) |
|---|
| | 698 | [realDragItems addObjectsFromArray:[[[adium contactController] allContactsWithService:[aDragItem service] |
|---|
| | 699 | UID:[aDragItem UID] |
|---|
| | 700 | existingOnly:YES] allObjects]]; |
|---|
| | 701 | } else { |
|---|
| | 702 | [realDragItems addObject:aDragItem]; |
|---|
| | 703 | } |
|---|
| | 704 | } |
|---|
| | 705 | |
|---|
| | 706 | [[adium contactController] moveListObjects:realDragItems intoObject:item index:index]; |
|---|
| | 707 | [outlineView reloadData]; |
|---|
| | 708 | } |
|---|
| | 709 | } |
|---|
| | 710 | |
|---|
| | 711 | //Call super and return its value |
|---|
| | 712 | return [super outlineView:outlineView acceptDrop:info item:item childIndex:index]; |
|---|
| | 713 | |
|---|
| | 714 | |
|---|