From 37d6649fa4d90b0528e8464489fdb28ccbc68e2a Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Thu, 22 Jan 2026 09:47:19 +0100 Subject: [PATCH] do not replace symbols by their rich text code as qml will handle it itself replace \n by
to handle carriage return --- Linphone/core/chat/ChatCore.cpp | 2 +- Linphone/data/languages/de.ts | 18 +++++++++--------- Linphone/data/languages/en.ts | 18 +++++++++--------- Linphone/data/languages/fr.ts | 18 +++++++++--------- Linphone/model/tool/ToolModel.cpp | 10 ++++++---- .../Control/Display/Chat/ChatTextContent.qml | 2 +- 6 files changed, 35 insertions(+), 33 deletions(-) diff --git a/Linphone/core/chat/ChatCore.cpp b/Linphone/core/chat/ChatCore.cpp index 5cb58be68..d128e1b3e 100644 --- a/Linphone/core/chat/ChatCore.cpp +++ b/Linphone/core/chat/ChatCore.cpp @@ -210,8 +210,8 @@ void ChatCore::setSelf(QSharedPointer me) { &ChatModel::newEvent, [this](const std::shared_ptr &chatRoom, const std::shared_ptr &eventLog) { if (mChatModel->getMonitor() != chatRoom) return; - lDebug() << "EVENT LOG RECEIVED IN CHATROOM" << mChatModel->getTitle(); if (!eventLog) return; + lDebug() << "EVENT LOG RECEIVED IN CHATROOM" << mChatModel->getTitle(); auto event = EventLogCore::create(eventLog, chatRoom); if (event->isHandled()) { mChatModelConnection->invokeToCore([this, event]() { emit eventsInserted({event}); }); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 135a3eb7c..ab6604219 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -6050,49 +6050,49 @@ Um sie in einem kommerziellen Projekt zu aktivieren, kontaktieren Sie uns bitte. ToolModel - + call_error_uninterpretable_sip_address "The calling address is not an interpretable SIP address : %1 Die Anrufadresse ist keine interpretierbare SIP-Adresse: %1 - + group_call_error_no_account Kein Standardkonto gefunden, Gruppengespräch kann nicht erstellt werden - + group_call_error_participants_invite Teilnehmer konnten nicht zum Gruppengespräch eingeladen werden - + group_call_error_creation Gruppengespräch konnte nicht erstellt werden - + voice_recording_duration "Voice recording (%1)" : %1 is the duration formated in mm:ss Sprachnachricht (%1) - + conference_invitation Meeting-Einladung - + conference_invitation_updated Meeting-Änderung - + conference_invitation_cancelled Meeting-Absage - + unknown_audio_device_name Unbekannter Gerätename diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index d24f26775..eaa2c3d96 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -5915,49 +5915,49 @@ To enable them in a commercial project, please contact us. ToolModel - + call_error_uninterpretable_sip_address "The calling address is not an interpretable SIP address : %1 The calling address is not an interpretable SIP address : %1 - + group_call_error_no_account No default account found, can't create group call - + group_call_error_participants_invite Couldn't invite participants to group call - + group_call_error_creation Group call couldn't be created - + voice_recording_duration "Voice recording (%1)" : %1 is the duration formated in mm:ss Voice recording (%1) - + unknown_audio_device_name Unknown device name - + conference_invitation Meeting invitation - + conference_invitation_cancelled Meeting cancellation - + conference_invitation_updated Meeting modification diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 84f75a637..944c0a69b 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -5886,49 +5886,49 @@ Pour les activer dans un projet commercial, merci de nous contacter. ToolModel - + call_error_uninterpretable_sip_address "The calling address is not an interpretable SIP address : %1 L'adresse n'est pas interprétable comme une adresse SIP - + group_call_error_no_account Impossible de créer l'appel de groupe, le compte par défaut n'est pas défini - + group_call_error_participants_invite Impossible d'inviter les participants à l'appel de groupe - + group_call_error_creation L'appel de groupe n'a pas pu être créé - + voice_recording_duration "Voice recording (%1)" : %1 is the duration formated in mm:ss Message vocal (%1) - + unknown_audio_device_name Appareil inconnu - + conference_invitation Invitation à une réunion - + conference_invitation_cancelled Annulation d'une réunion - + conference_invitation_updated Modification d'une réunion diff --git a/Linphone/model/tool/ToolModel.cpp b/Linphone/model/tool/ToolModel.cpp index bc5dcc714..831ef7dfb 100644 --- a/Linphone/model/tool/ToolModel.cpp +++ b/Linphone/model/tool/ToolModel.cpp @@ -160,11 +160,13 @@ QString ToolModel::encodeTextToQmlRichFormat(const QString &text, for (int i = 0; i < iriParsed.size(); ++i) { QString iri = iriParsed[i] - .second.replace('&', "&") + .second + // .replace('&', "&") .replace('<', "\u2063<") - .replace('>', "\u2063>") - .replace('"', """) - .replace('\'', "'"); + .replace('\n', "
"); + // .replace('>', "\u2063>") + // .replace('"', """) + // .replace('\'', "'"); if (!iriParsed[i].first) { if (lastWasUrl) { lastWasUrl = false; diff --git a/Linphone/view/Control/Display/Chat/ChatTextContent.qml b/Linphone/view/Control/Display/Chat/ChatTextContent.qml index b300e4c8b..2c3ae7855 100644 --- a/Linphone/view/Control/Display/Chat/ChatTextContent.qml +++ b/Linphone/view/Control/Display/Chat/ChatTextContent.qml @@ -31,7 +31,7 @@ TextEdit { contentGui.core.setSearchedTextPart(searchedTextPart) } - textFormat: Text.AutoText // To supports links and imgs. + textFormat: Text.RichText // To supports links and imgs. wrapMode: TextEdit.Wrap onLinkActivated: (link) => {