Mark chatroom as read-only if it is not secure and account has mandatory encryption
This commit is contained in:
parent
3edc55800a
commit
61fecd8c93
1 changed files with 5 additions and 1 deletions
|
|
@ -97,7 +97,11 @@ ChatCore::ChatCore(const std::shared_ptr<linphone::ChatRoom> &chatRoom) : QObjec
|
||||||
mIdentifier = Utils::coreStringToAppString(chatRoom->getIdentifier());
|
mIdentifier = Utils::coreStringToAppString(chatRoom->getIdentifier());
|
||||||
mChatRoomState = LinphoneEnums::fromLinphone(chatRoom->getState());
|
mChatRoomState = LinphoneEnums::fromLinphone(chatRoom->getState());
|
||||||
mIsEncrypted = chatRoom->hasCapability((int)linphone::ChatRoom::Capabilities::Encrypted);
|
mIsEncrypted = chatRoom->hasCapability((int)linphone::ChatRoom::Capabilities::Encrypted);
|
||||||
mIsReadOnly = chatRoom->isReadOnly();
|
auto localAccount = ToolModel::findAccount(chatRoom->getLocalAddress());
|
||||||
|
bool associatedAccountHasIMEncryptionMandatory =
|
||||||
|
localAccount && localAccount->getParams() &&
|
||||||
|
localAccount->getParams()->getInstantMessagingEncryptionMandatory();
|
||||||
|
mIsReadOnly = chatRoom->isReadOnly() || (!mIsEncrypted && associatedAccountHasIMEncryptionMandatory);
|
||||||
connect(this, &ChatCore::eventListChanged, this, &ChatCore::lUpdateLastMessage);
|
connect(this, &ChatCore::eventListChanged, this, &ChatCore::lUpdateLastMessage);
|
||||||
connect(this, &ChatCore::eventsInserted, this, &ChatCore::lUpdateLastMessage);
|
connect(this, &ChatCore::eventsInserted, this, &ChatCore::lUpdateLastMessage);
|
||||||
connect(this, &ChatCore::eventRemoved, this, &ChatCore::lUpdateLastMessage);
|
connect(this, &ChatCore::eventRemoved, this, &ChatCore::lUpdateLastMessage);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue