Fix the chat not scrolling every time when a new

message is posted.
This commit is contained in:
Guillaume BIENKOWSKI 2013-10-21 16:04:42 +02:00
parent 10ac514325
commit 69f88f2825
2 changed files with 6 additions and 8 deletions

View file

@ -93,12 +93,10 @@
}
- (void)scrollToBottom:(BOOL)animated {
CGSize size = [self.tableView contentSize];
CGRect bounds = [self.tableView bounds];
bounds.origin.y = size.height - bounds.size.height;
[self.tableView.layer removeAllAnimations];
[self.tableView scrollRectToVisible:bounds animated:animated];
[self.tableView reloadData];
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:([data count] - 1) inSection:0]
atScrollPosition:UITableViewScrollPositionBottom
animated:YES];
}
- (void)scrollToLastUnread:(BOOL)animated {

View file

@ -355,9 +355,9 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta
[chat setState:[NSNumber numberWithInt:1]]; //INPROGRESS
[chat create];
[tableController addChatEntry:chat];
[tableController scrollToBottom:TRUE];
[tableController scrollToBottom:true];
[chat release];
LinphoneChatMessage* msg = linphone_chat_room_create_message(chatRoom, [message UTF8String]);
linphone_chat_message_set_user_data(msg, [chat retain]);
if(externalUrl) {