mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-25 15:58:16 +00:00
- Fix unupdated participant in chat rooms (like admin status).
- Add log feedback on async admin set.
This commit is contained in:
parent
fd8d5570df
commit
4eb7fcd4b9
2 changed files with 6 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ void ParticipantListModel::updateParticipants () {
|
|||
mParticipants << participant;
|
||||
endInsertRows();
|
||||
changed = true;
|
||||
}else if(!(*itParticipant)->getParticipant()){
|
||||
}else if(!(*itParticipant)->getParticipant() || (*itParticipant)->getParticipant() != dbParticipant){
|
||||
(*itParticipant)->setParticipant(dbParticipant);
|
||||
changed = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "ChatRoomInitializer.hpp"
|
||||
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
#include "components/core/CoreManager.hpp"
|
||||
#include "components/core/CoreHandlers.hpp"
|
||||
|
|
@ -31,6 +32,7 @@ ChatRoomInitializer::ChatRoomInitializer(){}
|
|||
ChatRoomInitializer::~ChatRoomInitializer(){}
|
||||
|
||||
void ChatRoomInitializer::onConferenceJoined(const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<const linphone::EventLog> & eventLog) {
|
||||
qInfo() << "[ChatRoomInitializer] Conference has been set";
|
||||
if(mAdmins.size() > 0){
|
||||
setAdminsSync(chatRoom, mAdmins);
|
||||
}
|
||||
|
|
@ -40,15 +42,18 @@ void ChatRoomInitializer::onConferenceJoined(const std::shared_ptr<linphone::Cha
|
|||
|
||||
void ChatRoomInitializer::setAdminsSync(const std::shared_ptr<linphone::ChatRoom> & chatRoom, QList< std::shared_ptr<linphone::Address>> admins){
|
||||
std::list<std::shared_ptr<linphone::Participant>> chatRoomParticipants = chatRoom->getParticipants();
|
||||
int count = 0;
|
||||
for(auto participant : chatRoomParticipants){
|
||||
auto address = participant->getAddress();
|
||||
auto isAdmin = std::find_if(admins.begin(), admins.end(), [address](std::shared_ptr<linphone::Address> addr){
|
||||
return addr->weakEqual(address);
|
||||
});
|
||||
if( isAdmin != admins.end()){
|
||||
++count;
|
||||
chatRoom->setParticipantAdminStatus(participant, true);
|
||||
}
|
||||
}
|
||||
qInfo() << "[ChatRoomInitializer] '" << admins.size() << "' admin(s) specified in addition of Me, " << count << " set.";
|
||||
}
|
||||
|
||||
void ChatRoomInitializer::setAdminsAsync(const std::string& subject, const linphone::ChatRoomBackend& backend, const bool& groupEnabled, QList< std::shared_ptr<linphone::Address>> admins){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue