mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 09:49:26 +00:00
Avoid potential crash in canAdmniEphemeral chatroom function
This commit is contained in:
parent
2f3eb503b0
commit
038343812c
1 changed files with 3 additions and 1 deletions
|
|
@ -1651,6 +1651,8 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
|
||||
|
||||
-(BOOL) canAdminEphemeral:(LinphoneChatRoom *)cr {
|
||||
if (!cr) return FALSE;
|
||||
|
||||
// If ephemeral mode is DeviceManaged, then we don't need to check anything else
|
||||
return (linphone_chat_room_params_get_ephemeral_mode(linphone_chat_room_get_current_params(cr)) == LinphoneChatRoomEphemeralModeDeviceManaged)
|
||||
|| ( linphone_chat_room_has_capability(cr, LinphoneChatRoomCapabilitiesEphemeral) && linphone_chat_room_params_get_ephemeral_mode(linphone_chat_room_get_current_params(cr)) == LinphoneChatRoomEphemeralModeAdminManaged && linphone_participant_is_admin(linphone_chat_room_get_me(cr)));
|
||||
|
|
@ -1694,7 +1696,7 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
|
|||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return (_chatRoom && [self canAdminEphemeral:_chatRoom]) ? 3 : 2;
|
||||
return [self canAdminEphemeral:_chatRoom] ? 3 : 2;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue