fix display name in call notification #LINQT-1928

This commit is contained in:
Gaelle Braud 2025-09-03 09:52:35 +02:00
parent 13ef034516
commit f974a78fb9
7 changed files with 77 additions and 67 deletions

View file

@ -299,10 +299,14 @@ void Notifier::notifyReceivedCall(const shared_ptr<linphone::Call> &call) {
auto model = CallCore::create(call);
auto gui = new CallGui(model);
gui->moveToThread(App::getInstance()->thread());
App::postCoreAsync([this, gui]() {
QString displayName = call->getCallLog() && call->getCallLog()->getConferenceInfo()
? Utils::coreStringToAppString(call->getCallLog()->getConferenceInfo()->getSubject())
: Utils::coreStringToAppString(call->getRemoteAddress()->getDisplayName());
App::postCoreAsync([this, gui, displayName]() {
mustBeInMainThread(getClassName());
QVariantMap map;
map["displayName"].setValue(displayName);
map["call"].setValue(gui);
CREATE_NOTIFICATION(Notifier::ReceivedCall, map)
});

View file

@ -2143,79 +2143,79 @@ Error</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="70"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="69"/>
<source>chat_dialog_delete_chat_title</source>
<extracomment>Supprimer la conversation ?</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="72"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="71"/>
<source>chat_dialog_delete_chat_message</source>
<extracomment>&quot;La conversation et tous ses messages seront supprimés.&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="101"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="100"/>
<source>chat_list_title</source>
<extracomment>&quot;Conversations&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="122"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="121"/>
<source>menu_mark_all_as_read</source>
<extracomment>&quot;mark all as read&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="153"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="152"/>
<source>chat_search_in_history</source>
<extracomment>&quot;Rechercher une conversation&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="176"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="175"/>
<source>list_filter_no_result_found</source>
<extracomment>&quot;Aucun résultat&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="178"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="177"/>
<source>chat_list_empty_history</source>
<extracomment>&quot;Aucune conversation dans votre historique&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="247"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="246"/>
<source>chat_action_start_new_chat</source>
<extracomment>&quot;New chat&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="283"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="282"/>
<source>chat_start_group_chat_title</source>
<extracomment>&quot;Nouveau groupe&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="285"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="284"/>
<source>chat_action_start_group_chat</source>
<extracomment>&quot;Créer&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="311"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="315"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="310"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="314"/>
<source>information_popup_error_title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="313"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="312"/>
<source>group_chat_error_must_have_name</source>
<extracomment>&quot;Un nom doit être donné au groupe</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="317"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="316"/>
<source>group_call_error_not_connected</source>
<extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment>
<translation type="unfinished">Sie sind nicht verbunden</translation>
@ -4303,19 +4303,19 @@ Error</extracomment>
<context>
<name>NotificationReceivedCall</name>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="90"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="93"/>
<source>call_audio_incoming</source>
<extracomment>&quot;Appel entrant&quot;</extracomment>
<translation>Eingehender Anruf</translation>
</message>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="113"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="116"/>
<source>dialog_accept</source>
<extracomment>&quot;Accepter&quot;</extracomment>
<translation>Akzeptieren</translation>
</message>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="131"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="134"/>
<source>dialog_deny</source>
<extracomment>&quot;Refuser</extracomment>
<translation>Ablehnen</translation>
@ -4324,24 +4324,24 @@ Error</extracomment>
<context>
<name>Notifier</name>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="351"/>
<location filename="../../core/notifier/Notifier.cpp" line="355"/>
<source>new_voice_message</source>
<extracomment>&apos;Voice message received!&apos; : message to warn the user in a notofication for voice messages.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="352"/>
<location filename="../../core/notifier/Notifier.cpp" line="356"/>
<source>new_file_message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="355"/>
<location filename="../../core/notifier/Notifier.cpp" line="359"/>
<source>new_conference_invitation</source>
<extracomment>&apos;Conference invitation received!&apos; : Notification about receiving an invitation to a conference.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="371"/>
<location filename="../../core/notifier/Notifier.cpp" line="375"/>
<source>new_chat_room_messages</source>
<extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment>
<translation type="unfinished"></translation>

View file

@ -2106,79 +2106,79 @@ Only your correspondent can decrypt them.</translation>
<translation>No conversation</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="70"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="69"/>
<source>chat_dialog_delete_chat_title</source>
<extracomment>Supprimer la conversation ?</extracomment>
<translation>Delete conversation ?</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="72"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="71"/>
<source>chat_dialog_delete_chat_message</source>
<extracomment>&quot;La conversation et tous ses messages seront supprimés.&quot;</extracomment>
<translation>This conversation and all its messages will be deleted.</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="101"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="100"/>
<source>chat_list_title</source>
<extracomment>&quot;Conversations&quot;</extracomment>
<translation>Conversations</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="122"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="121"/>
<source>menu_mark_all_as_read</source>
<extracomment>&quot;mark all as read&quot;</extracomment>
<translation>Mark all as read</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="153"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="152"/>
<source>chat_search_in_history</source>
<extracomment>&quot;Rechercher une conversation&quot;</extracomment>
<translation>Search for a chat</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="176"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="175"/>
<source>list_filter_no_result_found</source>
<extracomment>&quot;Aucun résultat&quot;</extracomment>
<translation>No result</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="178"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="177"/>
<source>chat_list_empty_history</source>
<extracomment>&quot;Aucune conversation dans votre historique&quot;</extracomment>
<translation>No conversation in history</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="247"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="246"/>
<source>chat_action_start_new_chat</source>
<extracomment>&quot;New chat&quot;</extracomment>
<translation>New conversation</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="283"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="282"/>
<source>chat_start_group_chat_title</source>
<extracomment>&quot;Nouveau groupe&quot;</extracomment>
<translation>New group</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="285"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="284"/>
<source>chat_action_start_group_chat</source>
<extracomment>&quot;Créer&quot;</extracomment>
<translation>Create</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="311"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="315"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="310"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="314"/>
<source>information_popup_error_title</source>
<translation>Error</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="313"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="312"/>
<source>group_chat_error_must_have_name</source>
<extracomment>&quot;Un nom doit être donné au groupe</extracomment>
<translation>A name must be set for the group</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="317"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="316"/>
<source>group_call_error_not_connected</source>
<extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment>
<translation>You are not connected</translation>
@ -4204,19 +4204,19 @@ Expiration : %1</translation>
<context>
<name>NotificationReceivedCall</name>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="90"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="93"/>
<source>call_audio_incoming</source>
<extracomment>&quot;Appel entrant&quot;</extracomment>
<translation>Incoming call</translation>
</message>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="113"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="116"/>
<source>dialog_accept</source>
<extracomment>&quot;Accepter&quot;</extracomment>
<translation>Accept</translation>
</message>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="131"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="134"/>
<source>dialog_deny</source>
<extracomment>&quot;Refuser</extracomment>
<translation>Decline</translation>
@ -4225,24 +4225,24 @@ Expiration : %1</translation>
<context>
<name>Notifier</name>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="351"/>
<location filename="../../core/notifier/Notifier.cpp" line="355"/>
<source>new_voice_message</source>
<extracomment>&apos;Voice message received!&apos; : message to warn the user in a notofication for voice messages.</extracomment>
<translation>Voice message received!</translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="352"/>
<location filename="../../core/notifier/Notifier.cpp" line="356"/>
<source>new_file_message</source>
<translation>File received!</translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="355"/>
<location filename="../../core/notifier/Notifier.cpp" line="359"/>
<source>new_conference_invitation</source>
<extracomment>&apos;Conference invitation received!&apos; : Notification about receiving an invitation to a conference.</extracomment>
<translation>Conference invitation received !</translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="371"/>
<location filename="../../core/notifier/Notifier.cpp" line="375"/>
<source>new_chat_room_messages</source>
<extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment>
<translation>New messages received !</translation>

View file

@ -2106,79 +2106,79 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
<translation>Aucune conversation</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="70"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="69"/>
<source>chat_dialog_delete_chat_title</source>
<extracomment>Supprimer la conversation ?</extracomment>
<translation>Supprimer la conversation ?</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="72"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="71"/>
<source>chat_dialog_delete_chat_message</source>
<extracomment>&quot;La conversation et tous ses messages seront supprimés.&quot;</extracomment>
<translation>La conversation et tous ses messages seront supprimés.</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="101"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="100"/>
<source>chat_list_title</source>
<extracomment>&quot;Conversations&quot;</extracomment>
<translation>Conversations</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="122"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="121"/>
<source>menu_mark_all_as_read</source>
<extracomment>&quot;mark all as read&quot;</extracomment>
<translation>Tout marquer comme lu</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="153"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="152"/>
<source>chat_search_in_history</source>
<extracomment>&quot;Rechercher une conversation&quot;</extracomment>
<translation>Rechercher une conversation</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="176"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="175"/>
<source>list_filter_no_result_found</source>
<extracomment>&quot;Aucun résultat&quot;</extracomment>
<translation>Aucun résultat</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="178"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="177"/>
<source>chat_list_empty_history</source>
<extracomment>&quot;Aucune conversation dans votre historique&quot;</extracomment>
<translation>Aucune conversation dans votre historique</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="247"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="246"/>
<source>chat_action_start_new_chat</source>
<extracomment>&quot;New chat&quot;</extracomment>
<translation>Nouvelle conversation</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="283"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="282"/>
<source>chat_start_group_chat_title</source>
<extracomment>&quot;Nouveau groupe&quot;</extracomment>
<translation>Nouveau groupe</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="285"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="284"/>
<source>chat_action_start_group_chat</source>
<extracomment>&quot;Créer&quot;</extracomment>
<translation>Créer</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="311"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="315"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="310"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="314"/>
<source>information_popup_error_title</source>
<translation>Erreur</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="313"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="312"/>
<source>group_chat_error_must_have_name</source>
<extracomment>&quot;Un nom doit être donné au groupe</extracomment>
<translation>Un nom doit être donné au groupe</translation>
</message>
<message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="317"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="316"/>
<source>group_call_error_not_connected</source>
<extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment>
<translation>Vous n&apos;êtes pas connecté</translation>
@ -4204,19 +4204,19 @@ Expiration : %1</translation>
<context>
<name>NotificationReceivedCall</name>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="90"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="93"/>
<source>call_audio_incoming</source>
<extracomment>&quot;Appel entrant&quot;</extracomment>
<translation>Appel entrant</translation>
</message>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="113"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="116"/>
<source>dialog_accept</source>
<extracomment>&quot;Accepter&quot;</extracomment>
<translation>Accepter</translation>
</message>
<message>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="131"/>
<location filename="../../view/Control/Popup/Notification/NotificationReceivedCall.qml" line="134"/>
<source>dialog_deny</source>
<extracomment>&quot;Refuser</extracomment>
<translation>Refuser</translation>
@ -4225,24 +4225,24 @@ Expiration : %1</translation>
<context>
<name>Notifier</name>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="351"/>
<location filename="../../core/notifier/Notifier.cpp" line="355"/>
<source>new_voice_message</source>
<extracomment>&apos;Voice message received!&apos; : message to warn the user in a notofication for voice messages.</extracomment>
<translation>Message vocal reçu !</translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="352"/>
<location filename="../../core/notifier/Notifier.cpp" line="356"/>
<source>new_file_message</source>
<translation>Fichier reçu !</translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="355"/>
<location filename="../../core/notifier/Notifier.cpp" line="359"/>
<source>new_conference_invitation</source>
<extracomment>&apos;Conference invitation received!&apos; : Notification about receiving an invitation to a conference.</extracomment>
<translation>Nouvelle invitation à une conférence !</translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="371"/>
<location filename="../../core/notifier/Notifier.cpp" line="375"/>
<source>new_chat_room_messages</source>
<extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment>
<translation>Nouveaux messages reçus !</translation>

View file

@ -265,7 +265,7 @@ void ConferenceModel::onParticipantDeviceScreenSharingChanged(
void ConferenceModel::onStateChanged(const std::shared_ptr<linphone::Conference> &conference,
linphone::Conference::State newState) {
lDebug() << "onStateChanged:" << (int)newState;
lDebug() << log().arg("onStateChanged:") << (int)newState;
if (newState == linphone::Conference::State::Created) {
emit participantDeviceCountChanged(conference, mMonitor->getParticipantDeviceList().size());
if (mMonitor->getScreenSharingParticipant()) emit isScreenSharingEnabledChanged(true);

View file

@ -426,7 +426,10 @@ void CoreModel::onCallStateChanged(const std::shared_ptr<linphone::Core> &core,
QString command = Utils::coreStringToAppString(
core->getConfig()->getString(SettingsModel::UiSection, "command_line", ""));
QString userName = Utils::coreStringToAppString(call->getRemoteAddress()->getUsername());
QString displayName = Utils::coreStringToAppString(call->getRemoteAddress()->getDisplayName());
QString displayName =
call->getCallLog() && call->getCallLog()->getConferenceInfo()
? Utils::coreStringToAppString(call->getCallLog()->getConferenceInfo()->getSubject())
: Utils::coreStringToAppString(call->getRemoteAddress()->getDisplayName());
command = command.replace("$1", userName);
command = command.replace("$2", displayName);
Utils::runCommandLine(command);

View file

@ -15,8 +15,11 @@ Notification {
overriddenHeight: content.height
readonly property var call: notificationData && notificationData.call
readonly property var displayName: notificationData && notificationData.displayName
property var state: call.core.state
property var status: call.core.status
property var conference: call.core.conference
onStateChanged:{
if (state != LinphoneEnums.CallState.IncomingReceived){
close()
@ -72,7 +75,7 @@ Notification {
ColumnLayout {
spacing: 0
Text {
text: call.core.remoteName
text: displayName
Layout.fillWidth: true
Layout.maximumWidth: mainItem.width - content.leftPadding - content.rightPadding
Layout.alignment: Qt.AlignHCenter