Changeset 3510

Show
Ignore:
Timestamp:
12/30/06 19:04:43 (2 years ago)
Author:
timothy
Message:

Update the buddy list when one of the buddy's users changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Models/JVBuddy.m

    r3509 r3510  
    262262 
    263263- (void) setActiveUser:(MVChatUser *) user { 
     264        if( [_activeUser isEqual:user] ) 
     265                return; 
     266 
    264267        id old = _activeUser; 
    265268        _activeUser = [user retain]; 
    266269        [old release]; 
     270 
     271        [[NSNotificationCenter defaultCenter] postNotificationName:JVBuddyActiveUserChangedNotification object:self userInfo:nil]; 
    267272} 
    268273 
     
    570575                [self setActiveUser:user]; 
    571576 
     577        [[NSNotificationCenter defaultCenter] postNotificationName:JVBuddyUserCameOnlineNotification object:self userInfo:[NSDictionary dictionaryWithObject:user forKey:@"user"]]; 
     578 
    572579        if( cameOnline ) 
    573580                [[NSNotificationCenter defaultCenter] postNotificationName:JVBuddyCameOnlineNotification object:self userInfo:nil]; 
     
    583590                [self setActiveUser:[_users anyObject]]; 
    584591 
     592        [[NSNotificationCenter defaultCenter] postNotificationName:JVBuddyUserWentOfflineNotification object:self userInfo:[NSDictionary dictionaryWithObject:user forKey:@"user"]]; 
     593 
    585594        if( ! [_users count] ) 
    586595                [[NSNotificationCenter defaultCenter] postNotificationName:JVBuddyWentOfflineNotification object:self userInfo:nil]; 
     
    589598- (void) _buddyIdleUpdate:(NSNotification *) notification { 
    590599        MVChatUser *user = [notification object]; 
    591         NSNotification *note = [NSNotification notificationWithName:JVBuddyUserIdleTimeUpdatedNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:user, @"user", nil]]; 
     600        NSNotification *note = [NSNotification notificationWithName:JVBuddyUserIdleTimeUpdatedNotification object:self userInfo:[NSDictionary dictionaryWithObject:user forKey:@"user"]]; 
    592601        [[NSNotificationQueue defaultQueue] enqueueNotification:note postingStyle:NSPostASAP coalesceMask:( NSNotificationCoalescingOnName | NSNotificationCoalescingOnSender ) forModes:nil]; 
    593602}