diff --git a/Classes/ChatsListTableView.m b/Classes/ChatsListTableView.m index 069bfa5b5..af82794d7 100644 --- a/Classes/ChatsListTableView.m +++ b/Classes/ChatsListTableView.m @@ -146,9 +146,9 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *kCellId = @"UIChatCell"; UIChatCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; - if (cell == nil) { + if (cell == nil) cell = [[UIChatCell alloc] initWithIdentifier:kCellId]; - } + [cell setChatRoom:(LinphoneChatRoom *)bctbx_list_nth_data(_data, (int)[indexPath row])]; [super accessoryForCell:cell atPath:indexPath]; diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index 98c90bbdd..0d21a383e 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -88,14 +88,12 @@ NSString *text = [[FastAddressBook displayNameForAddress:linphone_chat_message_get_from_address(last_msg)] stringByAppendingFormat:@" : %@", [UIChatBubbleTextCell TextMessageForChat:last_msg]]; // shorten long messages - if ([text length] > 50) { + if ([text length] > 50) text = [[text substringToIndex:50] stringByAppendingString:@"[...]"]; - } + _chatContentLabel.text = text; - } else { + } else _chatContentLabel.text = nil; - _chatLatestTimeLabel.text = NSLocalizedString(@"Now", nil); - } [self updateUnreadBadge]; }