mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
parent
a1263b8b4c
commit
1c058b489d
1 changed files with 3 additions and 13 deletions
|
|
@ -40,17 +40,9 @@
|
|||
self.tableView.accessibilityIdentifier = @"ChatRoom list";
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[self clearEventList];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)clearEventList {
|
||||
for (NSValue *value in eventList) {
|
||||
LinphoneEventLog *event = (LinphoneEventLog *)[value pointerValue];
|
||||
linphone_event_log_unref(event);
|
||||
}
|
||||
[eventList removeAllObjects];
|
||||
}
|
||||
|
||||
|
|
@ -59,18 +51,16 @@
|
|||
return;
|
||||
[self clearEventList];
|
||||
LinphoneChatRoomCapabilitiesMask capabilities = linphone_chat_room_get_capabilities(_chatRoom);
|
||||
bctbx_list_t *chatRoomEvents = (capabilities & LinphoneChatRoomCapabilitiesOneToOne)
|
||||
bctbx_list_t *chatRoomEvents = (capabilities & LinphoneChatRoomCapabilitiesOneToOne)
|
||||
? linphone_chat_room_get_history_message_events(_chatRoom, 0)
|
||||
: linphone_chat_room_get_history_events(_chatRoom, 0);
|
||||
bctbx_list_t *chatRoomEventsHead = chatRoomEvents;
|
||||
|
||||
eventList = [[NSMutableArray alloc] initWithCapacity:bctbx_list_size(chatRoomEvents)];
|
||||
while (chatRoomEvents) {
|
||||
LinphoneEventLog *event = (LinphoneEventLog *)chatRoomEvents->data;
|
||||
[eventList addObject:[NSValue valueWithPointer:event]];
|
||||
[eventList addObject:[NSValue valueWithPointer:linphone_event_log_ref(event)]];
|
||||
chatRoomEvents = chatRoomEvents->next;
|
||||
}
|
||||
bctbx_list_free(chatRoomEventsHead);
|
||||
|
||||
for (FileTransferDelegate *ftd in [LinphoneManager.instance fileTransferDelegates]) {
|
||||
const LinphoneAddress *ftd_peer =
|
||||
|
|
@ -90,7 +80,7 @@
|
|||
}
|
||||
|
||||
- (void)addEventEntry:(LinphoneEventLog *)event {
|
||||
[eventList addObject:[NSValue valueWithPointer:event]];
|
||||
[eventList addObject:[NSValue valueWithPointer:linphone_event_log_ref(event)]];
|
||||
int pos = (int)eventList.count - 1;
|
||||
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:pos inSection:0];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue