From 2ae5bb9cec8b782590c3d4946b63908bea508e0c Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 23 Feb 2026 10:52:27 +0100 Subject: [PATCH] Chat list fixes: Force chat list to update when updating proxy sourceModel (otherwise list can be empty) Clear mList before anything else when updating chat list (may fix chat connection crash) --- Linphone/core/App.cpp | 7 ++++-- Linphone/core/chat/ChatList.cpp | 2 +- Linphone/core/chat/ChatProxy.cpp | 1 + Linphone/data/languages/de.ts | 22 +++++++++---------- Linphone/data/languages/en.ts | 22 +++++++++---------- Linphone/data/languages/fr.ts | 22 +++++++++---------- .../Display/Meeting/MeetingListView.qml | 1 - 7 files changed, 40 insertions(+), 37 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 3058801b6..a7cd4e302 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -729,7 +729,7 @@ void App::initCore() { mEngine->setObjectOwnership(settings.get(), QQmlEngine::CppOwnership); mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership); - connect(this, &App::coreStartedChanged, this, [this] { + auto initLists = [this] { if (mCoreStarted) { if (!mAccountList) setAccountList(AccountList::create()); else { @@ -753,7 +753,10 @@ void App::initCore() { else mChatList->lUpdate(); disconnect(this, &App::coreStartedChanged, this, nullptr); } - }); + }; + if (mCoreStarted) { + initLists(); + } else connect(this, &App::coreStartedChanged, this, initLists); // if (!mSettings) { mSettings = settings; diff --git a/Linphone/core/chat/ChatList.cpp b/Linphone/core/chat/ChatList.cpp index 0563a7053..f47847f19 100644 --- a/Linphone/core/chat/ChatList.cpp +++ b/Linphone/core/chat/ChatList.cpp @@ -103,6 +103,7 @@ void ChatList::setSelf(QSharedPointer me) { } setIsUpdating(true); beginResetModel(); + mList.clear(); mModelConnection->invokeToModel([this]() { mustBeInLinphoneThread(getClassName()); // Avoid copy to lambdas @@ -127,7 +128,6 @@ void ChatList::setSelf(QSharedPointer me) { disconnectItem(chat); } } - mList.clear(); for (auto &chat : *chats) { connectItem(chat); mList.append(chat); diff --git a/Linphone/core/chat/ChatProxy.cpp b/Linphone/core/chat/ChatProxy.cpp index 492008cf8..0a2c19035 100644 --- a/Linphone/core/chat/ChatProxy.cpp +++ b/Linphone/core/chat/ChatProxy.cpp @@ -51,6 +51,7 @@ void ChatProxy::setSourceModel(QAbstractItemModel *model) { } }); connect(newChatList, &ChatList::dataChanged, this, [this] { invalidate(); }); + newChatList->lUpdate(); } QSortFilterProxyModel::setSourceModel(newChatList); sort(0); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index e121bc232..29cc2a34f 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -2101,65 +2101,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… - + chat_message_draft_sending_text - + chat_room_delete "Delete" Löschen - + chat_room_mute - + chat_room_unmute "Mute" - + chat_room_mark_as_read "Mark as read" - + chat_room_leave "leave" - + chat_list_leave_chat_popup_title leave the conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? - + chat_list_delete_chat_popup_title Delete the conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 5bf329c75..fb44098fa 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -2094,65 +2094,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 is writing… - + chat_message_draft_sending_text Draft : %1 - + chat_room_delete "Delete" Delete - + chat_room_mute Mute - + chat_room_unmute "Mute" Unmute - + chat_room_mark_as_read "Mark as read" Mark as read - + chat_room_leave "leave" Leave - + chat_list_leave_chat_popup_title leave the conversation ? Leave the conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? - + chat_list_delete_chat_popup_title Delete the conversation ? Delete the conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? This conversation and all its messages will be deleted. Do You want to continue ? diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 820d01a4a..20214c813 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -2069,65 +2069,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 est en train d'écrire… - + chat_message_draft_sending_text Brouillon : %1 - + chat_room_delete "Delete" Supprimer - + chat_room_mute Mettre en sourdine - + chat_room_unmute "Mute" Enlever la sourdine - + chat_room_mark_as_read "Mark as read" Marquer comme lu - + chat_room_leave "leave" Quitter la conversation - + chat_list_leave_chat_popup_title leave the conversation ? Quitter la conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? Vous ne pourrez plus envoyer ou recevoir de messages dans cette conversation. Souhaitez-vous continuer ? - + chat_list_delete_chat_popup_title Delete the conversation ? Supprimer la conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? La conversation et tous ses messages seront supprimés. Souhaitez-vous continuer ? diff --git a/Linphone/view/Control/Display/Meeting/MeetingListView.qml b/Linphone/view/Control/Display/Meeting/MeetingListView.qml index 99401a7af..0026c0021 100644 --- a/Linphone/view/Control/Display/Meeting/MeetingListView.qml +++ b/Linphone/view/Control/Display/Meeting/MeetingListView.qml @@ -76,7 +76,6 @@ ListView { onAtYEndChanged: if(atYEnd) confInfoProxy.displayMore() Component.onCompleted: { - console.log("meeting list view completed invalidate") confInfoProxy.invalidate() }