Changeset 14670
- Timestamp:
- 12/30/2005 04:38:33 PM (3 years ago)
- Files:
-
- trunk/Plugins/Contact List/AIListController.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Plugins/Contact List/AIListController.m
r14554 r14670 15 15 */ 16 16 17 #import "AIChat.h" 18 #import "AIChatController.h" 17 19 #import "AIContactController.h" 20 #import "AIContentController.h" 21 #import "AIContentMessage.h" 18 22 #import "AIInterfaceController.h" 19 23 #import "AIListController.h" 20 24 #import "AIPreferenceController.h" 21 25 #import "ESFileTransfer.h" 26 #import <AIUtilities/AIAttributedStringAdditions.h> 22 27 #import <AIUtilities/AIAutoScrollView.h> 23 28 #import <AIUtilities/AIWindowAdditions.h> … … 493 498 - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(int)index 494 499 { 495 NSString *availableType = [[info draggingPasteboard] availableTypeFromArray:[NSArray arrayWithObject:@"AIListObject"]]; 500 BOOL success = YES; 501 NSString *availableType = [[info draggingPasteboard] availableTypeFromArray:[NSArray arrayWithObject:@"AIListObject"]]; 496 502 497 503 if ([availableType isEqualToString:@"AIListObject"]) { … … 529 535 AILocalizedString(@"Once combined, Adium will treat these contacts as a single individual both on your contact list and when sending messages.\n\nYou may un-combine these contacts by getting info on the combined contact.","Explanation of metacontact creation")); 530 536 } 531 //Drag and Drop for the contact list.532 537 } else if([[[info draggingPasteboard] types] containsObject:NSFilenamesPboardType]) { 538 //Drag and Drop file transfer for the contact list. 533 539 NSString *file; 534 540 NSArray *files = [[info draggingPasteboard] propertyListForType:NSFilenamesPboardType]; … … 536 542 537 543 while ((file = [enumerator nextObject])) { 538 AIListContact *targetFileTransferContact = [[adium contactController] preferredContactForContentType:FILE_TRANSFER_TYPE forListContact:item]; 544 AIListContact *targetFileTransferContact = [[adium contactController] preferredContactForContentType:FILE_TRANSFER_TYPE 545 forListContact:item]; 539 546 [[adium fileTransferController] sendFile:file toListContact:targetFileTransferContact]; 540 547 } 548 } else if([[[info draggingPasteboard] types] containsObject:NSRTFPboardType]) { 549 //Drag and drop text sending via the contact list. 550 AIListContact *contact = [[adium contactController] preferredContactForContentType:CONTENT_MESSAGE_TYPE 551 forListContact:item]; 552 553 if (contact) { 554 //XXX 555 //This is not the best method for doing this, but I can't figure out why the Message View 556 //won't let me add the text directly into it's text entry even if I expand AIWebKitMessageView. 557 558 //Open the chat and send the dragged text. 559 AIChat *chat; 560 AIContentMessage *messageContent; 561 562 chat = [[adium chatController] openChatWithContact:contact]; 563 messageContent = [AIContentMessage messageInChat:chat 564 withSource:[chat account] 565 destination:[chat listObject] 566 date:nil 567 message:[NSAttributedString stringWithData:[[info draggingPasteboard] dataForType:NSRTFPboardType]] 568 autoreply:NO]; 569 570 [[adium contentController] sendContentObject:messageContent]; 571 } else { 572 success = NO; 573 } 541 574 } 542 575 543 576 [super outlineView:outlineView acceptDrop:info item:item childIndex:index]; 544 577 545 return YES;578 return success; 546 579 } 547 580 - (void)mergeContactSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo