the maximum interval between 2 agglomerated chats at 5mn

This commit is contained in:
Danmei Chen 2018-12-10 11:17:35 +01:00
parent 52d83cc40e
commit b9d7c07fda

View file

@ -166,6 +166,8 @@
[self reloadData];
}
static const int MAX_AGGLOMERATED_TIME=300;
- (BOOL)isFirstIndexInTableView:(NSIndexPath *)indexPath chat:(LinphoneChatMessage *)chat {
LinphoneEventLog *previousEvent = nil;
NSInteger indexOfPreviousEvent = indexPath.row - 1;
@ -183,6 +185,10 @@
if (!linphone_address_equal(linphone_chat_message_get_from_address(previousChat), linphone_chat_message_get_from_address(chat))) {
return TRUE;
}
// the maximum interval between 2 agglomerated chats at 5mn
if ((linphone_chat_message_get_time(chat)-linphone_chat_message_get_time(previousChat)) > MAX_AGGLOMERATED_TIME) {
return TRUE;
}
return FALSE;
}