mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-22 15:38:33 +00:00
the maximum interval between 2 agglomerated chats at 5mn
This commit is contained in:
parent
52d83cc40e
commit
b9d7c07fda
1 changed files with 6 additions and 0 deletions
|
|
@ -166,6 +166,8 @@
|
||||||
[self reloadData];
|
[self reloadData];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const int MAX_AGGLOMERATED_TIME=300;
|
||||||
|
|
||||||
- (BOOL)isFirstIndexInTableView:(NSIndexPath *)indexPath chat:(LinphoneChatMessage *)chat {
|
- (BOOL)isFirstIndexInTableView:(NSIndexPath *)indexPath chat:(LinphoneChatMessage *)chat {
|
||||||
LinphoneEventLog *previousEvent = nil;
|
LinphoneEventLog *previousEvent = nil;
|
||||||
NSInteger indexOfPreviousEvent = indexPath.row - 1;
|
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))) {
|
if (!linphone_address_equal(linphone_chat_message_get_from_address(previousChat), linphone_chat_message_get_from_address(chat))) {
|
||||||
return TRUE;
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue