Changeset 25543
- Timestamp:
- 11/07/2008 11:00:20 AM (2 months ago)
- Files:
-
- trunk/Frameworks/Adium Framework/Source/AIAccount.h (modified) (1 diff)
- trunk/Frameworks/Adium Framework/Source/AIAccount.m (modified) (1 diff)
- trunk/Plugins/Purple Service/CBPurpleOscarAccount.m (modified) (1 diff)
- trunk/Plugins/Purple Service/ESIRCAccount.m (modified) (1 diff)
- trunk/Source/AIAutoReplyPlugin.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Frameworks/Adium Framework/Source/AIAccount.h
r25374 r25543 225 225 - (NSString *)encodedAttributedStringForSendingContentMessage:(AIContentMessage *)inContentMessage; 226 226 - (BOOL)rejoinChat:(AIChat*)chat; 227 /*! 228 * @brief Should an autoreply be sent to this message? 229 * 230 * This will only be called if the generic algorithm determines that an autoreply is appropriate. The account 231 * gets an opportunity to suppress sending the autoreply, e.g. on the basis of the message's content or source. 232 */ 233 - (BOOL)shouldSendAutoreplyToMessage:(AIContentMessage *)message; 227 234 228 235 //Presence Tracking trunk/Frameworks/Adium Framework/Source/AIAccount.m
r25444 r25543 647 647 { 648 648 return [self encodedAttributedString:[inContentMessage message] forListObject:[inContentMessage destination]]; 649 } 650 651 /*! 652 * @brief Should an autoreply be sent to this message? 653 * 654 * This will only be called if the generic algorithm determines that an autoreply is appropriate. The account 655 * gets an opportunity to suppress sending the autoreply, e.g. on the basis of the message's content or source. 656 */ 657 - (BOOL)shouldSendAutoreplyToMessage:(AIContentMessage *)message 658 { 659 return YES; 649 660 } 650 661 trunk/Plugins/Purple Service/CBPurpleOscarAccount.m
r24889 r25543 513 513 return success; 514 514 } 515 516 - (BOOL)shouldSendAutoreplyToMessage:(AIContentMessage *)message 517 { 518 return ![[message.message string] hasPrefix:@"[Offline IM sent"]; 519 } 520 515 521 516 522 #pragma mark DirectIM (IM Image) trunk/Plugins/Purple Service/ESIRCAccount.m
r25444 r25543 122 122 } 123 123 124 BOOL contactUIDIsServerContact(NSString *contactUID) 125 { 126 return (([contactUID caseInsensitiveCompare:@"nickserv"] == NSOrderedSame) || 127 ([contactUID caseInsensitiveCompare:@"chanserv"] == NSOrderedSame) || 128 ([contactUID rangeOfString:@"-connect" options:(NSBackwardsSearch | NSCaseInsensitiveSearch | NSAnchoredSearch)].location != NSNotFound)); 129 } 130 131 /*! 132 * @brief Can we send an offline message to this contact? 133 * 134 * We can only send offline messages to the server contacts, since such a message might cause us to connect 135 */ 124 136 - (BOOL)canSendOfflineMessageToContact:(AIListContact *)inContact 125 137 { 126 return ([[inContact.UID lowercaseString] isEqualToString:@"nickserv"] || 127 [[inContact.UID lowercaseString] isEqualToString:@"chanserv"]); 138 return contactUIDIsServerContact(inContact.UID); 139 } 140 141 - (BOOL)shouldSendAutoreplyToMessage:(AIContentMessage *)message 142 { 143 return !contactUIDIsServerContact(message.source.UID); 128 144 } 129 145 trunk/Source/AIAutoReplyPlugin.m
r25443 r25543 112 112 * was an offline message we're getting as we connect and it's older than 5 minutes 113 113 * (or the person sending it is no longer online) -RAF 114 * For AIM accounts, we know it is an offline message if it starts with "[Offline IM sent". Of course, a user could send a message like that... 115 * but said user deserves not to receive an auto-reply. 114 * We also give the account a chance to suppress the autoreply 116 115 */ 117 116 if ([[contentObject type] isEqualToString:CONTENT_MESSAGE_TYPE] && … … 120 119 !chat.isGroupChat && 121 120 (abs([contentObject.date timeIntervalSinceNow]) < 300) && 122 !([contentObject.source.serviceClass isEqualToString:@"AIM-compatible"] && [[contentObject.message string] hasPrefix:@"[Offline IM sent"])) {121 [[chat account] shouldSendAutoreplyToMessage:(AIContentMessage *)contentObject]) { 123 122 //300 is 5 minutes in seconds 124 123