修改UI
This commit is contained in:
@@ -895,7 +895,7 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
UIImage *cached = [self.chatAvatarCache objectForKey:urlString];
|
||||
if (cached) {
|
||||
message.avatarImage = cached;
|
||||
[self.chatPanelView kb_reloadWithMessages:self.chatMessages];
|
||||
[self kb_reloadChatRowForMessage:message];
|
||||
return;
|
||||
}
|
||||
if (![[KBFullAccessManager shared] hasFullAccess]) {
|
||||
@@ -919,11 +919,31 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
if (!self) {
|
||||
return;
|
||||
}
|
||||
[self.chatAvatarCache setObject:image forKey:urlString];
|
||||
message.avatarImage = image;
|
||||
[self.chatPanelView kb_reloadWithMessages:self.chatMessages];
|
||||
});
|
||||
}];
|
||||
[self.chatAvatarCache setObject:image forKey:urlString];
|
||||
message.avatarImage = image;
|
||||
[self kb_reloadChatRowForMessage:message];
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)kb_reloadChatRowForMessage:(KBChatMessage *)message {
|
||||
NSUInteger idx = [self.chatMessages indexOfObject:message];
|
||||
if (idx == NSNotFound) {
|
||||
[self.chatPanelView kb_reloadWithMessages:self.chatMessages];
|
||||
return;
|
||||
}
|
||||
UITableView *tableView = self.chatPanelView.tableView;
|
||||
if (!tableView) {
|
||||
[self.chatPanelView kb_reloadWithMessages:self.chatMessages];
|
||||
return;
|
||||
}
|
||||
if (idx >= (NSUInteger)[tableView numberOfRowsInSection:0]) {
|
||||
[self.chatPanelView kb_reloadWithMessages:self.chatMessages];
|
||||
return;
|
||||
}
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:idx inSection:0];
|
||||
[tableView reloadRowsAtIndexPaths:@[ indexPath ]
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
}
|
||||
|
||||
- (void)kb_requestChatAudioForText:(NSString *)text {
|
||||
|
||||
Reference in New Issue
Block a user