diff --git a/coreapi/local_conference.cpp b/coreapi/local_conference.cpp index 50377bd042f72fc6e476516adeae5231cfcd6c44..1127d0163dc77b7202c62aa7e739d6d89a834404 100644 --- a/coreapi/local_conference.cpp +++ b/coreapi/local_conference.cpp @@ -1265,7 +1265,7 @@ bool LocalConference::addParticipant(std::shared_ptr<LinphonePrivate::Call> call const_cast<LinphonePrivate::MediaSessionParams *>(call->getParams())->enableVideo(false); } - Conference::addParticipant(call); + bool success = Conference::addParticipant(call); const auto &participant = findParticipant(session->getRemoteAddress()); LinphoneMediaDirection audioDirection = LinphoneMediaDirectionInactive; @@ -1286,6 +1286,17 @@ bool LocalConference::addParticipant(std::shared_ptr<LinphonePrivate::Call> call videoDirection = LinphoneMediaDirectionInactive; break; } + + auto &mainDb = getCore()->getPrivate()->mainDb; + if (success && conferenceAddress && mainDb) { + auto conferenceInfo = mainDb->getConferenceInfoFromURI(conferenceAddress); + if (conferenceInfo) { + const auto &organizerAddress = conferenceInfo->getOrganizerAddress(); + if (organizerAddress && organizerAddress->weakEqual(*participant->getAddress())) { + setParticipantAdminStatus(participant, true); + } + } + } } const_cast<LinphonePrivate::MediaSessionParams *>(call->getParams())->setAudioDirection(audioDirection); @@ -2030,9 +2041,6 @@ void LocalConference::callStateChangedCb(LinphoneCore *lc, } } } - bool admin = remoteContactAddress->hasParam("admin") && - Utils::stob(remoteContactAddress->getParamValue("admin")); - setParticipantAdminStatus(participant, admin); } else { lError() << "Unable to update admin status and device address as no participant with address " << *remoteAddress << " has been found in conference " << *getConferenceAddress(); diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index 8155a552942ef50e3aff0f90cce54a9b1214e8b4..427d397f87bd2cad707d8f575a012bd056ce3b07 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -2086,12 +2086,6 @@ void CallSession::updateContactAddress(Address &contactAddress) const { } } #endif - - if (organizer) { - const auto localAddress = getLocalAddress(); - isAdmin = (organizer->weakEqual(*localAddress)); - contactAddress.setParam("admin", Utils::toString(isAdmin)); - } } }