Commit e1fe926b authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Fixed chat room security level when instanciated

parent 87cb164a
......@@ -380,6 +380,12 @@ ChatRoom::SecurityLevel ClientGroupChatRoom::getSecurityLevel () const {
return AbstractChatRoom::SecurityLevel::ClearText;
}
// Until participant list & self devices list is populated, don't assume chat room is safe but encrypted
if (getParticipants().size() == 0 && getMe()->getPrivate()->getDevices().size() == 0) {
lInfo() << "Chatroom SecurityLevel = Encrypted";
return AbstractChatRoom::SecurityLevel::Encrypted;
}
bool isSafe = true;
// check other participants
for (const auto &participant : getParticipants()) {
......
......@@ -429,8 +429,10 @@ LinphoneChatRoom * create_chat_room_client_side_with_expected_number_of_particip
if (!chatRoom) return NULL;
BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateInstantiated, initialStats->number_of_LinphoneChatRoomStateInstantiated + 1, 100));
if (encrypted)
if (encrypted) {
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(chatRoom), LinphoneChatRoomSecurityLevelEncrypted, LinphoneChatRoomSecurityLevel, "%i");
BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(chatRoom) & LinphoneChatRoomCapabilitiesEncrypted);
}
// Check that the chat room is correctly created on Marie's side and that the participants are added
BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateCreationPending, initialStats->number_of_LinphoneChatRoomStateCreationPending + 1, 5000));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment