From 6657c26b87ed4c56f82b36125409b1ac24040162 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 15 Dec 2025 10:38:49 +0100 Subject: [PATCH] FIXES: hide sip address in conversation info if hide_sip_addresses set write account presence note event if empty (otherwise it cannot be cleaned) add chatroom to list when Created state signal received fix navigation to create contact from conversation infos display copy sip address even if participant is in contact list --- Linphone/core/chat/ChatList.cpp | 13 ++ Linphone/data/languages/de.ts | 114 +++++++++--------- Linphone/data/languages/en.ts | 114 +++++++++--------- Linphone/data/languages/fr.ts | 114 +++++++++--------- Linphone/model/account/AccountModel.cpp | 6 +- .../Page/Layout/Chat/ConversationInfos.qml | 2 +- .../Layout/Chat/GroupChatInfoParticipants.qml | 1 - .../view/Page/Main/Contact/ContactPage.qml | 20 +-- 8 files changed, 199 insertions(+), 185 deletions(-) diff --git a/Linphone/core/chat/ChatList.cpp b/Linphone/core/chat/ChatList.cpp index fda3866cb..7a7bf38d3 100644 --- a/Linphone/core/chat/ChatList.cpp +++ b/Linphone/core/chat/ChatList.cpp @@ -170,6 +170,19 @@ void ChatList::setSelf(QSharedPointer me) { const std::shared_ptr &reaction) { addChatToList(core, room, message); }); + mModelConnection->makeConnectToModel( + &CoreModel::chatRoomStateChanged, + [this, addChatToList](const std::shared_ptr &core, + const std::shared_ptr &chatRoom, linphone::ChatRoom::State state) { + if (state == linphone::ChatRoom::State::Created) { + if (chatRoom->getAccount() != core->getDefaultAccount()) { + qWarning() << log().arg("Chatroom does not refer to current account, return"); + return; + } + auto chatCore = ChatCore::create(chatRoom); + mModelConnection->invokeToCore([this, chatCore] { addChatInList(chatCore); }); + } + }); connect(this, &ChatList::filterChanged, [this](QString filter) { mFilter = filter; diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index ff15e0e03..252ba4587 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -3007,149 +3007,149 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! Zurzeit keine Kontakte - + contact_new_title "Nouveau contact" Neuer Kontakt - + create Erstellen - + contact_edit_title "Modifier contact" Kontakt bearbeiten - + save Speichern - + contact_dialog_delete_title Supprimer %1 ?" %1 löschen? - + contact_dialog_delete_message Ce contact sera définitivement supprimé. Dieser Kontakt wird dauerhaft gelöscht. - + contact_deleted_toast "Contact supprimé" Kontakt gelöscht - + contact_deleted_message "%1 a été supprimé" %1 wurde gelöscht - + contact_dialog_devices_trust_popup_title "Augmenter la confiance" Vertrauenslevel erhöhen - + contact_dialog_devices_trust_popup_message "Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.<br><br>Vous êtes sur le point d’appeler “%1” voulez vous continuer ?" Um das Vertrauenslevel zu erhöhen müssen Sie Ihren Kontakt anrufen und einen Code bestätigen.<br><br>Sie sind dabei, "%1" anzurufen. Möchten Sie fortfahren? - + popup_do_not_show_again Ne plus afficher Nicht mehr anzeigen - + cancel Abbrechen - + dialog_call "Appeler" Anrufen - + contact_dialog_devices_trust_help_title "Niveau de confiance" Vertrauenslevel - + contact_dialog_devices_trust_help_message "Vérifiez les appareils de votre contact pour confirmer que vos communications seront sécurisées et sans compromission. <br>Quand tous seront vérifiés, vous atteindrez le niveau de confiance maximal." Überprüfen Sie die Geräte Ihres Kontakts um sicherzustellen, dass Ihre Kommunikation sicher und unkompromittiert ist. Wenn alle Geräte überprüft sind, erreichen Sie das höchste Vertrauenslevel. - + dialog_ok "Ok" Ok - + bottom_navigation_contacts_label "Contacts" Kontakte - + create_contact_accessible_name Create new contact Neuen Kontakt erstellen - + search_bar_look_for_contact_text Rechercher un contact Kontakt suchen - + list_filter_no_result_found Aucun résultat… Kein Ergebnis… - + contact_list_empty Aucun contact pour le moment Zurzeit keine Kontakte - + more_info_accessible_name More info %1 Weitere Informationen %1 - + expand_accessible_name Expand %1 Vergrößern %1 - + shrink_accessible_name Shrink %1 Verkleinern %1 - - + + contact_details_edit Edit ---------- @@ -3157,19 +3157,19 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! Bearbeiten - + contact_call_action "Appel" Anrufen - + contact_message_action "Message" Nachricht - + contact_video_call_action "Appel vidéo" Videoanruf @@ -3195,133 +3195,133 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! Offline - + contact_details_numbers_and_addresses_title "Coordonnées" Kontaktinformationen - + call_adress_accessible_name Call address %1 Adresse %1 anrufen - + contact_details_company_name "Société :" Unternehmen : - + contact_details_job_title "Poste :" Beruf : - + contact_details_medias_title "Medias" Medien - - + + contact_details_medias_subtitle "Afficher les medias partagés" Geteilte Medien anzeigen - + contact_details_trust_title "Confiance" Vertrauen - + contact_dialog_devices_trust_title "Niveau de confiance - Appareils vérifiés" Vertrauenslevel - Verifizierte Geräte - + contact_details_no_device_found "Aucun appareil" Kein Gerät - + contact_device_without_name "Appareil inconnu" Unbekanntes Gerät - + contact_make_call_check_device_trust "Vérifier" Überprüfen - + verify_device_accessible_name Verify %1 device Gerät %1 verifizieren - + contact_details_actions_title "Autres actions" Weitere Aktionen - + contact_details_remove_from_favourites "Retirer des favoris" Aus Favoriten entfernen - + contact_details_add_to_favourites "Ajouter aux favoris" Zu Favoriten hinzufügen - + contact_details_share "Partager" Teilen - + information_popup_error_title Fehler - + contact_details_share_error_mesage "La création du fichier vcard a échoué" VCard-Erstellung fehlgeschlagen - + contact_details_share_success_title "VCard créée" VCard erstellt - + contact_details_share_success_mesage "VCard du contact enregistrée dans %1" VCard wurde in %1 gespeichert - + contact_details_share_email_title "Partage de contact" Kontakt teilen - + contact_details_delete "Supprimer ce contact" Kontakt löschen @@ -3915,7 +3915,7 @@ Ablauf: %1 Admin - + group_infos_manage_participants_title "Gérer des participants" Manage Participants @@ -3943,22 +3943,22 @@ Ablauf: %1 Administratorrechte entfernen - + group_infos_copy_sip_address SIP-Adresse kopieren - + group_infos_remove_participant Teilnehmer entfernen - + group_infos_remove_participants_toast_title Teilnehmer entfernen? - + group_infos_remove_participants_toast_message Teilnehmer wird aus dem Chat entfernt. diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index bf5b15b77..d06262eaa 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -2935,149 +2935,149 @@ Only your correspondent can decrypt them. No contact at the moment - + contact_new_title "Nouveau contact" New contact - + create Create - + contact_edit_title "Modifier contact" Edit contact - + save Save - + contact_dialog_delete_title Supprimer %1 ?" Delete %1? - + contact_dialog_delete_message Ce contact sera définitivement supprimé. This contact will be permanently deleted. - + contact_deleted_toast "Contact supprimé" Contact deleted - + contact_deleted_message "%1 a été supprimé" %1 has been deleted - + contact_dialog_devices_trust_popup_title "Augmenter la confiance" Increase trust level - + contact_dialog_devices_trust_popup_message "Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.<br><br>Vous êtes sur le point d’appeler “%1” voulez vous continuer ?" To increase trust level you must call your contact's devices and validate a code.<br><br>You are about to call "%1" do you want to continue? - + popup_do_not_show_again Ne plus afficher Do not show again - + cancel Cancel - + dialog_call "Appeler" Call - + contact_dialog_devices_trust_help_title "Niveau de confiance" Trust level - + contact_dialog_devices_trust_help_message "Vérifiez les appareils de votre contact pour confirmer que vos communications seront sécurisées et sans compromission. <br>Quand tous seront vérifiés, vous atteindrez le niveau de confiance maximal." Verify your contact's devices to confirm that your communications will be secure and uncompromised. When all are verified, you will reach the maximum trust level. - + dialog_ok "Ok" Ok - + bottom_navigation_contacts_label "Contacts" Contacts - + search_bar_look_for_contact_text Rechercher un contact Find contact - + list_filter_no_result_found Aucun résultat… No result… - + contact_list_empty Aucun contact pour le moment No contact at the moment - + expand_accessible_name Expand %1 Expand %1 - + shrink_accessible_name Shrink %1 Shrink %1 - + create_contact_accessible_name Create new contact Create new contact - + more_info_accessible_name More info %1 More info %1 - - + + contact_details_edit Edit ---------- @@ -3085,151 +3085,151 @@ Only your correspondent can decrypt them. Edit - + contact_call_action "Appel" Call - + contact_message_action "Message" Message - + contact_video_call_action "Appel vidéo" Video call - + contact_details_numbers_and_addresses_title "Coordonnées" Contact details - + call_adress_accessible_name Call address %1 Call address %1 - + contact_details_company_name "Société :" Company : - + contact_details_job_title "Poste :" Job : - + contact_details_medias_title "Medias" Medias - - + + contact_details_medias_subtitle "Afficher les medias partagés" Show shared media - + contact_details_trust_title "Confiance" Trust - + contact_dialog_devices_trust_title "Niveau de confiance - Appareils vérifiés" Trust Level - Verified Devices - + contact_details_no_device_found "Aucun appareil" No device - + contact_device_without_name "Appareil inconnu" Unknown device - + contact_make_call_check_device_trust "Vérifier" Verify - + verify_device_accessible_name Verify %1 device Verify %1 device - + contact_details_actions_title "Autres actions" Other actions - + contact_details_remove_from_favourites "Retirer des favoris" Remove from favorites - + contact_details_add_to_favourites "Ajouter aux favoris" Add to favorites - + contact_details_share "Partager" Share - + information_popup_error_title Error - + contact_details_share_error_mesage "La création du fichier vcard a échoué" VCard creation failed - + contact_details_share_success_title "VCard créée" VCard created - + contact_details_share_success_mesage "VCard du contact enregistrée dans %1" VCard has been saved in %1 - + contact_details_share_email_title "Partage de contact" Share contact - + contact_details_delete "Supprimer ce contact" Delete contact @@ -3813,7 +3813,7 @@ Expiration : %1 GroupChatInfoParticipants - + group_infos_manage_participants_title "Gérer des participants" Manage participants @@ -3846,22 +3846,22 @@ Expiration : %1 Remove admin rights - + group_infos_copy_sip_address Copy SIP Address - + group_infos_remove_participant Remove participant - + group_infos_remove_participants_toast_title Remove participant ? - + group_infos_remove_participants_toast_message Participant will be removed from chat room. diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index df919946e..212adc53b 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -2930,149 +2930,149 @@ en bout. Seul votre correspondant peut les déchiffrer. Aucun contact pour le moment - + contact_new_title "Nouveau contact" Nouveau contact - + create Créer - + contact_edit_title "Modifier contact" Modifier contact - + save Enregistrer - + contact_dialog_delete_title Supprimer %1 ?" Supprimer %1 ? - + contact_dialog_delete_message Ce contact sera définitivement supprimé. Ce contact sera définitivement supprimé. - + contact_deleted_toast "Contact supprimé" Contact supprimé - + contact_deleted_message "%1 a été supprimé" %1 a été supprimé - + contact_dialog_devices_trust_popup_title "Augmenter la confiance" Augmenter la confiance - + contact_dialog_devices_trust_popup_message "Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.<br><br>Vous êtes sur le point d’appeler “%1” voulez vous continuer ?" Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.<br><br>Vous êtes sur le point d’appeler “%1” voulez vous continuer ? - + popup_do_not_show_again Ne plus afficher Ne plus afficher - + cancel Annuler - + dialog_call "Appeler" Appeler - + contact_dialog_devices_trust_help_title "Niveau de confiance" Niveau de confiance - + contact_dialog_devices_trust_help_message "Vérifiez les appareils de votre contact pour confirmer que vos communications seront sécurisées et sans compromission. <br>Quand tous seront vérifiés, vous atteindrez le niveau de confiance maximal." Vérifiez les appareils de votre contact pour confirmer que vos communications seront sécurisées et sans compromission. <br>Quand tous seront vérifiés, vous atteindrez le niveau de confiance maximal. - + dialog_ok "Ok" Ok - + bottom_navigation_contacts_label "Contacts" Contacts - + search_bar_look_for_contact_text Rechercher un contact Rechercher un contact - + list_filter_no_result_found Aucun résultat… Aucun résultat… - + contact_list_empty Aucun contact pour le moment Aucun contact pour le moment - + expand_accessible_name Expand %1 Étendre %1 - + shrink_accessible_name Shrink %1 Réduire %1 - + create_contact_accessible_name Create new contact Créer un nouveau contact - + more_info_accessible_name More info %1 Plus d'information %1 - - + + contact_details_edit Edit ---------- @@ -3080,151 +3080,151 @@ en bout. Seul votre correspondant peut les déchiffrer. Éditer - + contact_call_action "Appel" Appel - + contact_message_action "Message" Message - + contact_video_call_action "Appel vidéo" Appel vidéo - + contact_details_numbers_and_addresses_title "Coordonnées" Coordonnées - + call_adress_accessible_name Call address %1 Appeller l'adresse %1 - + contact_details_company_name "Société :" Société : - + contact_details_job_title "Poste :" Poste : - + contact_details_medias_title "Medias" Medias - - + + contact_details_medias_subtitle "Afficher les medias partagés" Afficher les medias partagés - + contact_details_trust_title "Confiance" Confiance - + contact_dialog_devices_trust_title "Niveau de confiance - Appareils vérifiés" Niveau de confiance - Appareils vérifiés - + contact_details_no_device_found "Aucun appareil" Aucun appareil - + contact_device_without_name "Appareil inconnu" Appareil inconnu - + contact_make_call_check_device_trust "Vérifier" Vérifier - + verify_device_accessible_name Verify %1 device Vérifier l'appareil %1 - + contact_details_actions_title "Autres actions" Autres actions - + contact_details_remove_from_favourites "Retirer des favoris" Retirer des favoris - + contact_details_add_to_favourites "Ajouter aux favoris" Ajouter aux favoris - + contact_details_share "Partager" Partager - + information_popup_error_title Erreur - + contact_details_share_error_mesage "La création du fichier vcard a échoué" La création du fichier vcard a échoué - + contact_details_share_success_title "VCard créée" VCard créée - + contact_details_share_success_mesage "VCard du contact enregistrée dans %1" VCard du contact enregistrée dans %1 - + contact_details_share_email_title "Partage de contact" Partage de contact - + contact_details_delete "Supprimer ce contact" Supprimer ce contact @@ -3808,7 +3808,7 @@ Expiration : %1 GroupChatInfoParticipants - + group_infos_manage_participants_title "Gérer des participants" Gérer les participants @@ -3841,22 +3841,22 @@ Expiration : %1 Retirer les droits admins - + group_infos_copy_sip_address Copier l’adresse SIP - + group_infos_remove_participant Retirer le participant - + group_infos_remove_participants_toast_title Retirer le participant ? - + group_infos_remove_participants_toast_message La participant sere retiré de la conversation diff --git a/Linphone/model/account/AccountModel.cpp b/Linphone/model/account/AccountModel.cpp index 62d35f0c3..5e38d1eaf 100644 --- a/Linphone/model/account/AccountModel.cpp +++ b/Linphone/model/account/AccountModel.cpp @@ -563,10 +563,8 @@ void AccountModel::setPresence(LinphoneEnums::Presence presence, core->getConfig()->sync(); } - if (!presenceNote.isEmpty()) { - core->getConfig()->setString(accountSection, "presence_note", Utils::appStringToCoreString(presenceNote)); - core->getConfig()->sync(); - } + core->getConfig()->setString(accountSection, "presence_note", Utils::appStringToCoreString(presenceNote)); + core->getConfig()->sync(); if (!mMonitor->getParams()->publishEnabled()) { auto params = mMonitor->getParams()->clone(); diff --git a/Linphone/view/Page/Layout/Chat/ConversationInfos.qml b/Linphone/view/Page/Layout/Chat/ConversationInfos.qml index 35bb8319d..4457055b5 100644 --- a/Linphone/view/Page/Layout/Chat/ConversationInfos.qml +++ b/Linphone/view/Page/Layout/Chat/ConversationInfos.qml @@ -156,7 +156,7 @@ ColumnLayout { Text { font: Typography.p3 color: DefaultStyle.main2_700 - text: mainItem.chatCore.peerAddress + text: SettingsCpp.hideSipAddresses ? UtilsCpp.getUsername(mainItem.chatCore.peerAddress) : mainItem.chatCore.peerAddress Layout.alignment: Qt.AlignHCenter Layout.topMargin: Utils.getSizeWithScreenRatio(5) } diff --git a/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml b/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml index ad50a401e..fcf8bb300 100644 --- a/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml +++ b/Linphone/view/Page/Layout/Chat/GroupChatInfoParticipants.qml @@ -149,7 +149,6 @@ ColumnLayout { } } IconLabelButton { - visible: !contact || (contact.core && !contact.core.isAppFriend) Layout.fillWidth: true text: qsTr("group_infos_copy_sip_address") icon.source: AppIcons.copy diff --git a/Linphone/view/Page/Main/Contact/ContactPage.qml b/Linphone/view/Page/Main/Contact/ContactPage.qml index 47008aadc..778f9519e 100644 --- a/Linphone/view/Page/Main/Contact/ContactPage.qml +++ b/Linphone/view/Page/Main/Contact/ContactPage.qml @@ -31,9 +31,9 @@ AbstractMainPage { } onVisibleChanged: if (!visible) { - rightPanelStackView.clear() - contactList.resetSelections() - } + rightPanelStackView.clear() + contactList.resetSelections() + } function goToContactDetails() { if (selectedContact) { var firstItem = rightPanelStackView.get(0) @@ -55,15 +55,20 @@ AbstractMainPage { } } onSelectedContactChanged: { - goToContactDetails() + console.log("selected contact changed, go to contact details") + // if we are editing a contact, force staying on edition page + if (!rightPanelStackView.currentItem + || rightPanelStackView.currentItem.objectName != "contactEdition") { + goToContactDetails() + } } onNoItemButtonPressed: createContact("", "") function createContact(name, address) { var friendGui = Qt.createQmlObject('import Linphone -FriendGui{ -}', mainItem) + FriendGui{ + }', mainItem) friendGui.core.givenName = UtilsCpp.getGivenNameFromFullName(name) friendGui.core.familyName = UtilsCpp.getFamilyNameFromFullName(name) friendGui.core.appendAddress(address) @@ -840,8 +845,7 @@ FriendGui{ //: "Supprimer ce contact" text: qsTr("contact_details_delete") onClicked: { - mainItem.deleteContact( - mainItem.selectedContact) + mainItem.deleteContact(mainItem.selectedContact) } style: ButtonStyle.noBackgroundRed }