Changeset 20107
- Timestamp:
- 07/05/2007 02:44:48 PM (1 year ago)
- Files:
-
- trunk/Source/AIContactStatusEventsPlugin.m (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Source/AIContactStatusEventsPlugin.m
r19247 r20107 24 24 25 25 @interface AIContactStatusEventsPlugin (PRIVATE) 26 - (BOOL)updateCache:(NSMutableDictionary *)cache forKey:(NSString *)key newValue:(id)newStatus listObject:(AIListObject *)inObject performCompare:(BOOL)performCompare; 26 - (BOOL)updateCache:(NSMutableDictionary *)cache 27 forKey:(NSString *)key 28 newValue:(id)newStatus 29 listObject:(AIListObject *)inObject 30 performCompare:(BOOL)performCompare; 27 31 @end 28 32 … … 286 290 287 291 if ([self updateCache:onlineCache 288 forKey:@"Online"289 newValue:newValue290 listObject:inObject291 performCompare:YES]) {292 forKey:@"Online" 293 newValue:newValue 294 listObject:inObject 295 performCompare:YES]) { 292 296 if (!silent) { 293 297 NSString *event = ([newValue boolValue] ? CONTACT_STATUS_ONLINE_YES : CONTACT_STATUS_ONLINE_NO); … … 328 332 newStatusMessage = [[inObject statusMessage] string]; 329 333 statusMessageChanged = [self updateCache:statusMessageCache 330 forKey:@"StatusMessage" 331 newValue:newStatusMessage 332 listObject:inObject 333 performCompare:YES]; 334 334 forKey:@"StatusMessage" 335 newValue:newStatusMessage 336 listObject:inObject 337 performCompare:YES]; 335 338 if (statusMessageChanged && !silent) { 336 339 if (newStatusMessage != nil) { … … 346 349 if (awayChanged && !silent) { 347 350 NSString *event = ([newAwayNumber boolValue] ? CONTACT_STATUS_AWAY_YES : CONTACT_STATUS_AWAY_NO); 348 NSDictionary *userInfo ;351 NSDictionary *userInfo = nil; 349 352 350 userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:(statusMessageChanged && (newStatusMessage != nil))] 351 forKey:@"Already Posted StatusMessage"]; 353 if ([event isEqualToString:CONTACT_STATUS_AWAY_YES] && 354 (statusMessageChanged && (newStatusMessage != nil))) { 355 userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] 356 forKey:@"Already Posted StatusMessage"]; 357 } 352 358 353 359 [[adium contactAlertsController] generateEvent:event … … 361 367 id newValue = [inObject numberStatusObjectForKey:@"IsIdle" fromAnyContainedObject:NO]; 362 368 if ([self updateCache:idleCache 363 forKey:@"IsIdle"364 newValue:newValue365 listObject:inObject366 performCompare:YES] && !silent) {369 forKey:@"IsIdle" 370 newValue:newValue 371 listObject:inObject 372 performCompare:YES] && !silent) { 367 373 NSString *event = ([newValue boolValue] ? CONTACT_STATUS_IDLE_YES : CONTACT_STATUS_IDLE_NO); 368 374 [[adium contactAlertsController] generateEvent:event … … 402 408 [cache removeObjectForKey:[inObject internalObjectID]]; 403 409 } 410 404 411 return YES; 405 412 } else {