fix isFirst chat cell not showed correctly

This commit is contained in:
Danmei Chen 2021-03-05 09:36:15 +01:00
parent 317665a90b
commit 368f1e1810

View file

@ -193,12 +193,11 @@ static const int BASIC_EVENT_LIST=15;
- (BOOL)isFirstIndexInTableView:(NSIndexPath *)indexPath chat:(LinphoneChatMessage *)chat {
LinphoneEventLog *previousEvent = nil;
NSInteger indexOfPreviousEvent = indexPath.row - 1;
while (!previousEvent && indexOfPreviousEvent > -1) {
LinphoneEventLog *tmp = [[eventList objectAtIndex:indexOfPreviousEvent] pointerValue];
if (linphone_event_log_get_type(tmp) == LinphoneEventLogTypeConferenceChatMessage) {
previousEvent = tmp;
if (indexOfPreviousEvent > -1) {
previousEvent = [[eventList objectAtIndex:indexOfPreviousEvent] pointerValue];
if (linphone_event_log_get_type(previousEvent) != LinphoneEventLogTypeConferenceChatMessage) {
return TRUE;
}
--indexOfPreviousEvent;
}
if (!previousEvent)
return TRUE;