Changeset 194
- Timestamp:
- 28-01-2008 11:39:39 (5 years ago)
- Location:
- trunk/lilypad/Sources
- Files:
-
- 3 modified
-
LPAccount.h (modified) (1 diff)
-
LPGroupChat.m (modified) (1 diff)
-
LPGroupChatController.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lilypad/Sources/LPAccount.h
r152 r194 24 24 25 25 26 @class LPRoster , LPChat, LPGroupChat, LPContact, LPContactEntry, LPFileTransfer;26 @class LPRoster; 27 27 @class LPServerItemsInfo, LPSapoAgents; 28 28 @class LPPubManager; -
trunk/lilypad/Sources/LPGroupChat.m
r147 r194 257 257 LPGroupChatContact *contact = [m_participantsByNickname objectForKey:oldNickname]; 258 258 259 [contact retain]; 259 260 [m_participantsByNickname removeObjectForKey:oldNickname]; 260 261 [contact handleChangedNickname:newNickname]; 261 262 [m_participantsByNickname setObject:contact forKey:newNickname]; 263 [contact release]; 262 264 } 263 265 -
trunk/lilypad/Sources/LPGroupChatController.m
r189 r194 33 33 34 34 // KVO Contexts 35 static NSString *LPGroupChatContext = @"GroupChatContext"; 35 36 static NSString *LPGroupChatParticipantsContext = @"ParticipantsContext"; 36 37 static NSString *LPParticipantsAttribsContext = @"PartAttributesContext"; … … 90 91 NSUserDefaultsController *prefsCtrl = [NSUserDefaultsController sharedUserDefaultsController]; 91 92 92 [m_groupChat addObserver:self forKeyPath:@"active" options:0 context:NULL]; 93 [m_groupChat addObserver:self forKeyPath:@"nickname" options:0 context:NULL]; 94 [m_groupChat addObserver:self forKeyPath:@"myGroupChatContact.affiliation" options:0 context:NULL]; 93 [m_groupChat addObserver:self forKeyPath:@"active" options:0 context:LPGroupChatContext]; 94 [m_groupChat addObserver:self forKeyPath:@"nickname" options:0 context:LPGroupChatContext]; 95 [m_groupChat addObserver:self forKeyPath:@"myGroupChatContact" options:0 context:LPGroupChatContext]; 96 [m_groupChat addObserver:self forKeyPath:@"myGroupChatContact.affiliation" options:0 context:LPGroupChatContext]; 95 97 [prefsCtrl addObserver:self forKeyPath:@"values.DisplayEmoticonImages" options:0 context:NULL]; 96 98 … … 114 116 [prefsCtrl removeObserver:self forKeyPath:@"values.DisplayEmoticonImages"]; 115 117 [m_groupChat removeObserver:self forKeyPath:@"myGroupChatContact.affiliation"]; 118 [m_groupChat removeObserver:self forKeyPath:@"myGroupChatContact"]; 116 119 [m_groupChat removeObserver:self forKeyPath:@"nickname"]; 117 120 [m_groupChat removeObserver:self forKeyPath:@"active"]; … … 210 213 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 211 214 { 212 if ([keyPath isEqualToString:@"active"] || [keyPath isEqualToString:@"myGroupChatContact.affiliation"]) { 213 // Update menus and the toolbar as action validation results may have changed 214 [NSApp setWindowsNeedUpdate:YES]; 215 } 216 else if ([keyPath isEqualToString:@"nickname"]) { 217 // Our nickname in the group chat has just changed 218 [m_chatViewsController setOwnerName:[[m_groupChat myGroupChatContact] userPresentableNickname]]; 215 if (context == LPGroupChatContext) { 216 if ([keyPath isEqualToString:@"active"] || [keyPath isEqualToString:@"myGroupChatContact.affiliation"]) { 217 // Update menus and the toolbar as action validation results may have changed 218 [NSApp setWindowsNeedUpdate:YES]; 219 } 220 else if ([keyPath isEqualToString:@"myGroupChatContact"] || [keyPath isEqualToString:@"nickname"]) { 221 // Our nickname in the group chat has just changed 222 LPGroupChatContact *myGroupChatContact = [m_groupChat myGroupChatContact]; 223 if (myGroupChatContact != nil) { 224 [m_chatViewsController setOwnerName:[myGroupChatContact userPresentableNickname]]; 225 } 226 } 219 227 } 220 228 else if (context == LPGroupChatParticipantsContext) {