Changeset 18363
- Timestamp:
- 12/07/2006 03:10:05 PM (2 years ago)
- Files:
-
- trunk/Plugins/Gaim Service/adiumGaimConversation.m (modified) (3 diffs)
- trunk/Plugins/Gaim Service/ESGaimAIMAccount.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Plugins/Gaim Service/adiumGaimConversation.m
r17726 r18363 21 21 #import <Adium/AIHTMLDecoder.h> 22 22 #import <Adium/AIListContact.h> 23 #import <Adium/AIContentControllerProtocol.h> 23 24 24 25 #pragma mark Gaim Images … … 151 152 } else if ([messageString rangeOfString:@"closed the conversation"].location != NSNotFound) { 152 153 updateType = AIChatClosedWindow; 154 } else if ([messageString rangeOfString:@"Direct IM established"].location != NSNotFound) { 155 //Should reorganize.. this is silly, grafted on top of the previous system which added a signal to Gaim 156 [accountLookup(conv->account) updateContact:[chat listObject] 157 forEvent:[NSNumber numberWithInt:GAIM_BUDDY_DIRECTIM_CONNECTED]]; 158 159 } else if (([messageString rangeOfString:@"The remote user has closed the connection."].location != NSNotFound) || 160 ([messageString rangeOfString:@"The remote user has declined your request."].location != NSNotFound) || 161 ([messageString rangeOfString:@"Lost connection with the remote user:"].location != NSNotFound) || 162 ([messageString rangeOfString:@"Received invalid data on connection with remote user"].location != NSNotFound) || 163 ([messageString rangeOfString:@"Could not establish a connection with the remote user."].location != NSNotFound)) { 164 //Display the message if it's not just the one for the other guy closing it...note that this needs to be localized 165 if ([messageString rangeOfString:@"The remote user has closed the connection."].location == NSNotFound) { 166 [[[AIObject sharedAdiumInstance] contentController] displayEvent:messageString 167 ofType:@"directIMDisconnected" 168 inChat:chat]; 169 } 170 171 [accountLookup(conv->account) updateContact:[chat listObject] 172 forEvent:[NSNumber numberWithInt:GAIM_BUDDY_DIRECTIM_DISCONNECTED]]; 153 173 } 154 174 … … 156 176 [accountLookup(conv->account) updateForChat:chat 157 177 type:[NSNumber numberWithInt:updateType]]; 158 } 178 } else { 179 //If we don't know what to do with this message, display it! 180 [[[AIObject sharedAdiumInstance] contentController] displayEvent:messageString 181 ofType:@"libgaimMessage" 182 inChat:chat]; 183 } 159 184 } 160 185 } else if (flags & GAIM_MESSAGE_ERROR) { trunk/Plugins/Gaim Service/ESGaimAIMAccount.m
r18358 r18363 222 222 conn = peer_connection_find_by_type(od, who, OSCAR_CAPABILITY_DIRECTIM); 223 223 224 returnString = [self stringByProcessingImgTagsForDirectIM:returnString]; 225 224 226 if ((conn != NULL) && (conn->ready)) { 225 //We have a connected dim already; process the string and keep the modified copy 226 returnString = [self stringByProcessingImgTagsForDirectIM:returnString]; 227 //We have a connected dim already; simply continue, and we'll be told to send it in a moment 227 228 228 229 } else { … … 242 243 243 244 [thisContactQueue addObject:inContentMessage]; 244 245 //Return nil for now to indicate that the message should not be sent246 returnString = nil;247 245 } 248 246 } … … 283 281 return NO; 284 282 } 283 } 284 285 - (BOOL)sendMessageObject:(AIContentMessage *)inContentMessage 286 { 287 if (directIMQueue) { 288 NSMutableArray *thisContactQueue = [directIMQueue objectForKey:[[inContentMessage destination] internalObjectID]]; 289 if ([thisContactQueue containsObject:inContentMessage]) { 290 //This message is in our queue of messages to send... 291 PeerConnection *conn; 292 OscarData *od = (OscarData *)account->gc->proto_data; 293 const char *who = [[[inContentMessage destination] UID] UTF8String]; 294 295 conn = peer_connection_find_by_type(od, who, OSCAR_CAPABILITY_DIRECTIM); 296 297 if ((conn != NULL) && (conn->ready)) { 298 //We have a connected dim ready; send it! We already displayed it, though, so don't do that. 299 [inContentMessage setDisplayContent:NO]; 300 return [super sendMessageObject:inContentMessage]; 301 } else { 302 //Don't send now, as we'll do the actual send when the dim is connected, in directIMConnected: above, and return here. 303 return YES; 304 } 305 } 306 } 307 308 return [super sendMessageObject:inContentMessage]; 285 309 } 286 310