Ticket #1880: autorejoin.diff
| File autorejoin.diff, 7.7 kB (added by erik006, 10 months ago) |
|---|
-
Frameworks/Adium
old new 181 181 - (BOOL)sendMessageObject:(AIContentMessage *)inMessageObject; 182 182 - (NSString *)encodedAttributedString:(NSAttributedString *)inAttributedString forListObject:(AIListObject *)inListObject; 183 183 - (NSString *)encodedAttributedStringForSendingContentMessage:(AIContentMessage *)inContentMessage; 184 -(BOOL)rejoinChat:(AIChat*)chat; 184 185 185 186 //Presence Tracking 186 187 - (BOOL)contactListEditable; -
Frameworks/Adium
old new 122 122 } 123 123 124 124 /*! 125 * @brief rejoinChat 126 * 127 * Rejoin the open group chats after disconnect 128 */ 129 -(BOOL)rejoinChat:(AIChat*)chat 130 { 131 return NO; 132 } 133 134 /*! 125 135 * @brief Disconnect 126 136 * 127 137 * Disconnect the account, transitioning it into an offline state. -
Frameworks/Adium
old new 141 141 } 142 142 } 143 143 144 /*@brief: holds information passed upon the creation of the chat: 145 * handle, server, etc. 146 */ 144 147 - (NSDictionary *)chatCreationDictionary 145 148 { 146 149 return [self statusObjectForKey:@"ChatCreationInfo"]; -
Plugins/Purple
old new 707 707 return ([self online] && [self secureConnection]); 708 708 } 709 709 710 //the account just connected 710 711 - (void)didConnect { 711 712 gateways = [[NSMutableArray alloc] init]; 712 713 -
Plugins/Purple
old new 177 177 andAliases:(NSArray *)aliasesArray 178 178 newArrivals:(NSNumber *)newArrivals 179 179 toChat:(AIChat *)chat; 180 180 -(BOOL)rejoinChat:(AIChat*)chat; 181 181 #pragma mark Privacy 182 182 - (void)privacyPermitListAdded:(NSString *)sourceUID; 183 183 - (void)privacyDenyListAdded:(NSString *)sourceUID; -
Plugins/Purple
old new 582 582 return YES; 583 583 } 584 584 585 /* 586 * @brief rejoinChat 587 * overrides the method in the superclass AIAccount 588 * this method is called when the account is reconnected. 589 * It will reconnect any open group chats, returning YES on success. 590 */ 591 -(BOOL)rejoinChat:(AIChat*)chat 592 { 593 id identifier = [[chat identifier] retain]; 594 595 //we clear the identifier to create a new purple conversation 596 //for this chat 597 [chat setIdentifier:nil]; 598 [purpleThread openChat:chat onAccount:self]; 599 [chat setIdentifier:identifier]; 600 [[chat identifier] release]; 601 602 //created chat succesfully 603 return YES; 604 } 605 585 606 - (AIChat *)chatWithContact:(AIListContact *)contact identifier:(id)identifier 586 607 { 587 608 AIChat *chat = [[adium chatController] chatWithContact:contact]; -
Plugins/Purple
old new 520 520 } 521 521 */ 522 522 523 //Join the chat serverside - the GH sahTable components, couple with the originating PurpleConnect,523 //Join the chat serverside - the GHashTable components, couple with the originating PurpleConnect, 524 524 //now contains all the information the prpl will need to process our request. 525 525 AILog(@"In the event of an emergency, your GHashTable may be used as a flotation device..."); 526 526 serv_join_chat(gc, components); … … 642 642 // We handle the notify messages within SLPurpleCocoaAdapter so we can use our localized string macro 643 643 - (void *)handleNotifyMessageOfType:(PurpleNotifyType)type withTitle:(const char *)title primary:(const char *)primary secondary:(const char *)secondary; 644 644 { 645 645 646 NSString *primaryString = [NSString stringWithUTF8String:primary]; 646 647 NSString *secondaryString = secondary ? [NSString stringWithUTF8String:secondary] : nil; 647 648 -
Source/AIListBookmark.m
old new 212 212 return [NSString stringWithFormat:@"<%@:%x %@ - %@>",NSStringFromClass([self class]), self, [self formattedUID], [self chatCreationDictionary]]; 213 213 } 214 214 215 216 217 215 218 @end -
Source/AIChatController.m
old new 6 6 // 7 7 8 8 #import "AIChatController.h" 9 9 #import <AIListBookmark.h> 10 10 #import <Adium/AIContentControllerProtocol.h> 11 11 #import <Adium/AIContactControllerProtocol.h> 12 12 #import <Adium/AIInterfaceControllerProtocol.h> … … 78 78 name:AIAppWillTerminateNotification 79 79 object:nil]; 80 80 81 //observe connection notices, so we can re-connect group chats after disconnect 82 [[adium notificationCenter] addObserver:self 83 selector:@selector(accountDidConnect:) 84 name:ACCOUNT_CONNECTED 85 object:nil]; 86 81 87 //Ignore menu item for contacts in group chats 82 88 menuItem_ignore = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@"" 83 89 target:self … … 740 746 } 741 747 } 742 748 } 749 /* @brief Called when an account connected 750 * we want to check for chats to re-create 751 */ 752 -(void)accountDidConnect:(NSNotification*)notification{ 743 753 754 NSEnumerator *chatEnumerator = [[self openChats] objectEnumerator]; 755 AIChat *currentChat; 756 757 while((currentChat = [chatEnumerator nextObject])) { 758 if([currentChat isGroupChat] && ([[currentChat account] isEqualTo:[notification object]]) && [currentChat isOpen]) { 759 760 //since there is no callback from libpurple if the chat failed, the result of rejoining will always be true 761 AILog(@"rejoined chat <<%@>> on acccount: %@: %@", currentChat, [notification object],[[notification object] rejoinChat:currentChat] ? @"TRUE" : @"FALSE"); 762 763 } 764 } 765 } 766 767 768 744 769 #pragma mark Ignore 745 770 /*! 746 771 * @brief Toggle ignoring of a contact … … 840 865 return [NSString stringWithFormat:AILocalizedString(@"%@ invites you to join the chat \"%@\"", nil), [inAccount formattedUID], room]; 841 866 } 842 867 868 869 843 870 @end -
Source/AIAddBookmarkPlugin.m
old new 55 55 onWindow:[[[adium interfaceController] activeChat] window] 56 56 notifyingTarget:self]; 57 57 } 58 58 // @brief: create a bookmark for the given chat with the given name in the given group 59 59 - (void)createBookmarkForChat:(AIChat *)chat withName:(NSString *)name inGroup:(AIListGroup *)group 60 60 { 61 61 AIListBookmark *bookmark = [[adium contactController] bookmarkForChat:chat];