Adium

Changeset 20107

Show
Ignore:
Timestamp:
07/05/2007 02:44:48 PM (1 year ago)
Author:
evands
Message:

This is what [20106] was supposed to be: Fixed display of 'contact came back' messages: We don't display available messages, so don't claimed we already posted a statusmessage change when we're not dealing with an away status

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/AIContactStatusEventsPlugin.m

    r19247 r20107  
    2424 
    2525@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; 
    2731@end 
    2832 
     
    286290 
    287291                        if ([self updateCache:onlineCache 
    288                                                   forKey:@"Online" 
    289                                                 newValue:newValue 
    290                                           listObject:inObject 
    291                                   performCompare:YES]) { 
     292                                                  forKey:@"Online" 
     293                                                newValue:newValue 
     294                                          listObject:inObject 
     295                                  performCompare:YES]) { 
    292296                                if (!silent) { 
    293297                                        NSString        *event = ([newValue boolValue] ? CONTACT_STATUS_ONLINE_YES : CONTACT_STATUS_ONLINE_NO); 
     
    328332                                newStatusMessage = [[inObject statusMessage] string]; 
    329333                                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];                            
    335338                                if (statusMessageChanged && !silent) { 
    336339                                        if (newStatusMessage != nil) { 
     
    346349                                if (awayChanged && !silent) { 
    347350                                        NSString                *event = ([newAwayNumber boolValue] ? CONTACT_STATUS_AWAY_YES : CONTACT_STATUS_AWAY_NO); 
    348                                         NSDictionary    *userInfo
     351                                        NSDictionary    *userInfo = nil
    349352                                         
    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                                        } 
    352358 
    353359                                        [[adium contactAlertsController] generateEvent:event 
     
    361367                                id newValue = [inObject numberStatusObjectForKey:@"IsIdle" fromAnyContainedObject:NO]; 
    362368                                if ([self updateCache:idleCache 
    363                                                           forKey:@"IsIdle" 
    364                                                         newValue:newValue 
    365                                                   listObject:inObject 
    366                                           performCompare:YES] && !silent) { 
     369                                                          forKey:@"IsIdle" 
     370                                                        newValue:newValue 
     371                                                  listObject:inObject 
     372                                          performCompare:YES] && !silent) { 
    367373                                        NSString        *event = ([newValue boolValue] ? CONTACT_STATUS_IDLE_YES : CONTACT_STATUS_IDLE_NO); 
    368374                                        [[adium contactAlertsController] generateEvent:event 
     
    402408                        [cache removeObjectForKey:[inObject internalObjectID]]; 
    403409                } 
     410 
    404411                return YES; 
    405412        } else {