Remove participant before the onParticipantRemoved callback on ChatRoom so the participants list is correct in the callback

This commit is contained in:
Sylvain Berfini 2017-11-10 14:36:30 +01:00
parent 33edd95a15
commit e43d58fb2b

View file

@ -317,6 +317,8 @@ void ClientGroupChatRoom::onParticipantRemoved (const shared_ptr<ConferenceParti
return;
}
dConference->participants.remove(participant);
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(this);
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(cr);
LinphoneChatRoomCbsParticipantRemovedCb cb = linphone_chat_room_cbs_get_participant_removed(cbs);
@ -324,8 +326,6 @@ void ClientGroupChatRoom::onParticipantRemoved (const shared_ptr<ConferenceParti
if (cb)
cb(cr, L_GET_C_BACK_PTR(event));
dConference->participants.remove(participant);
}
void ClientGroupChatRoom::onParticipantSetAdmin (const shared_ptr<ConferenceParticipantEvent> &event, bool isFullState) {