Changeset 229
- Timestamp:
- 05-03-2008 16:54:37 (5 years ago)
- Files:
-
- 1 modified
-
trunk/lilypad/Sources/LPChatController.m (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lilypad/Sources/LPChatController.m
r214 r229 8 8 // 9 9 // For more information on licensing, read the README file. 10 // Para mais informa ções sobre o licenciamento, leia o ficheiro README.10 // Para mais informaes sobre o licenciamento, leia o ficheiro README. 11 11 // 12 12 … … 55 55 56 56 @interface LPChatController (Private) 57 - (void)p_syncChatOwnerName; 58 - (void)p_syncViewsWithContact; 57 59 58 60 - (void)p_setChat:(LPChat *)chat; … … 231 233 232 234 235 - (void)p_syncChatOwnerName 236 { 237 238 NSString *currentOwnerName = [m_chatViewsController ownerName]; 239 NSString *globalName = [[LPAccountsController sharedAccountsController] name]; 240 NSString *newOwnerName = ( [globalName length] > 0 ? 241 globalName : 242 [[[m_chat activeContactEntry] account] JID] ); 243 244 if (![currentOwnerName isEqualToString:newOwnerName]) 245 [m_chatViewsController setOwnerName:newOwnerName]; 246 } 247 248 233 249 - (void)p_syncViewsWithContact 234 250 { … … 238 254 239 255 [m_chatWebView setChat:m_chat]; 240 241 [m_chatViewsController setOwnerName:[[LPAccountsController sharedAccountsController] name]]; 256 [self p_syncChatOwnerName]; 242 257 243 258 [m_topControlsBar setBackgroundColor: … … 482 497 else if ([keyPath isEqualToString:@"name"]) { 483 498 // [LPAccountsController sharedAccountsController] name 484 [ m_chatViewsController setOwnerName:[[LPAccountsController sharedAccountsController] name]];499 [self p_syncChatOwnerName]; 485 500 } 486 501 else if ([keyPath isEqualToString:@"contactEntries"]) { … … 1498 1513 - (void)p_appendStandardMessageBlockWithInnerHTML:(NSString *)innerHTML timestamp:(NSDate *)timestamp inbound:(BOOL)isInbound saveInHistory:(BOOL)shouldSave scrollMode:(LPScrollToVisibleMode)scrollMode 1499 1514 { 1500 NSString *authorName = (isInbound ? [m_contact name] : [[LPAccountsController sharedAccountsController] name]); 1515 NSString *authorName = nil; 1516 if (isInbound) { 1517 authorName = [m_contact name]; 1518 } else { 1519 NSString *globalName = [[LPAccountsController sharedAccountsController] name]; 1520 authorName = ( [globalName length] > 0 ? 1521 globalName : 1522 [[[[self chat] activeContactEntry] account] JID] ); 1523 } 1524 1501 1525 NSString *htmlString = [m_chatViewsController HTMLStringForStandardBlockWithInnerHTML:innerHTML timestamp:timestamp authorName:authorName]; 1502 1526