Only create chat if 1-1 call, it should already exist in conference if available

add me in chatroom participants view #LINQT-2312

update admin status on conference joined #LINQT-2311

fix composing status when user starts writing message #LINQT-2317

do not force presence if disabled in account params #LINQT-2318

fix chat uin 1-1 call #LINQT-2322
This commit is contained in:
gaelle 2026-01-08 16:20:07 +01:00 committed by Gaelle Braud
parent f2f29a0d7c
commit 12c12ad2b5
9 changed files with 558 additions and 570 deletions

View file

@ -198,7 +198,11 @@ void ChatCore::setSelf(QSharedPointer<ChatCore> me) {
emit conferenceJoined();
});
}
mChatModelConnection->invokeToCore([this, participants]() { setParticipants(participants); });
auto meAdmin = chatRoom->getMe() && chatRoom->getMe()->isAdmin();
mChatModelConnection->invokeToCore([this, participants, meAdmin]() {
setParticipants(participants);
setMeAdmin(meAdmin);
});
});
// Events (excluding messages)
@ -621,6 +625,8 @@ ChatCore::buildParticipants(const std::shared_ptr<linphone::ChatRoom> &chatRoom)
auto participantCore = ParticipantCore::create(participant);
result.append(participantCore);
}
auto meCore = ParticipantCore::create(chatRoom->getMe());
if (meCore) result.append(meCore);
return result;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -566,12 +566,6 @@ void AccountModel::setPresence(LinphoneEnums::Presence presence,
core->getConfig()->setString(accountSection, "presence_note", Utils::appStringToCoreString(presenceNote));
core->getConfig()->sync();
if (!mMonitor->getParams()->publishEnabled()) {
auto params = mMonitor->getParams()->clone();
params->enablePublish(true);
mMonitor->setParams(params);
}
auto presenceModel = ToolModel::appPresenceToCorePresenceModel(presence, presenceNote);
core->setPresenceModel(presenceModel); // No api (yet) at the account level

View file

@ -1589,8 +1589,11 @@ VariantObject *Utils::getCurrentCallChat(CallGui *call) {
auto chatCore = ChatCore::create(linphoneChatRoom);
return QVariant::fromValue(new ChatGui(chatCore));
} else {
// Only try to create chatroom if 1-1 call
if (!callModel->getConference()) {
lInfo() << "[Utils] Did not find existing chat room, create one";
linphoneChatRoom = ToolModel::createCurrentCallChat(callModel);
}
if (linphoneChatRoom != nullptr) {
lInfo() << "[Utils] Chatroom created with" << callModel->getRemoteAddress()->asStringUriOnly();
auto id = linphoneChatRoom->getIdentifier();

View file

@ -81,6 +81,7 @@ FocusScope {
Layout.fillWidth: true
Layout.preferredHeight: Utils.getSizeWithScreenRatio(49)
focus: true
isError: groupNameItem.errorMessage !== ""
KeyNavigation.down: addParticipantsLayout //participantList.count > 0 ? participantList : searchbar
Accessible.name: qsTr("group_start_dialog_subject_hint")
}

View file

@ -506,7 +506,7 @@ FocusScope {
if (chat) messageSender.text = mainItem.chat.core.sendingText
}
onTextChanged: {
if (text !== "" && mainItem.chat.core.composingName !== "") {
if (text !== "") {
mainItem.chat.core.lCompose()
}
var lastChar = text.slice(-1)

View file

@ -56,7 +56,7 @@ AbstractWindow {
zrtpValidation.open()
}
} else if (callState === LinphoneEnums.CallState.StreamsRunning) {
if (!mainWindow.chat && mainWindow.conference.core.isChatEnabled)
if (!mainWindow.chat && (!mainWindow.conference || mainWindow.conference.core.isChatEnabled))
mainWindow.chatObj = UtilsCpp.getCurrentCallChat(mainWindow.call)
} else if (callState === LinphoneEnums.CallState.Error
|| callState === LinphoneEnums.CallState.End) {