From 768546296055b8689f5e9aa2b73b044ddabcf30b Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 28 Jan 2026 14:49:35 +0100 Subject: [PATCH] add debug in crashing connect for debug --- Linphone/core/chat/ChatCore.cpp | 14 ++++++++++++++ Linphone/core/search/MagicSearchList.cpp | 2 ++ Linphone/data/languages/de.ts | 2 +- Linphone/data/languages/en.ts | 2 +- Linphone/data/languages/fr.ts | 2 +- Linphone/model/chat/message/ChatMessageModel.cpp | 4 +++- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Linphone/core/chat/ChatCore.cpp b/Linphone/core/chat/ChatCore.cpp index c39303a5f..27e3ef7b4 100644 --- a/Linphone/core/chat/ChatCore.cpp +++ b/Linphone/core/chat/ChatCore.cpp @@ -223,10 +223,24 @@ void ChatCore::setSelf(const QSharedPointer &me) { mChatModelConnection->makeConnectToModel( &ChatModel::chatMessagesReceived, [this](const std::shared_ptr &chatRoom, const std::list> &eventsLog) { + if (!mChatModel) { + lWarning() << log().arg("Chat model is null !"); + return; + } else if (!mChatModelConnection) { + lWarning() << log().arg("Connection between Core and Model is null !"); + return; + } if (mChatModel->getMonitor() != chatRoom) return; lDebug() << log().arg("CHAT MESSAGE RECEIVED IN CHATROOM") << this << mChatModel->getTitle(); + lInfo() << log().arg("Chat message received in chatroom") << this << mChatModel->getTitle(); + lInfo() << log().arg("Safe Connection =") << mChatModelConnection.get(); + lInfo() << log().arg("this =") << this; QList> list; for (auto &e : eventsLog) { + if (!e) { + lWarning() << log().arg("Event log is null, continue"); + continue; + } auto event = EventLogCore::create(e, chatRoom); list.push_back(event); } diff --git a/Linphone/core/search/MagicSearchList.cpp b/Linphone/core/search/MagicSearchList.cpp index 922e6d7ba..cddbfe1f0 100644 --- a/Linphone/core/search/MagicSearchList.cpp +++ b/Linphone/core/search/MagicSearchList.cpp @@ -92,6 +92,8 @@ void MagicSearchList::setSelf(const QSharedPointer &me) { mModelConnection->makeConnectToModel( &MagicSearchModel::searchResultsReceived, [this](const std::list> &results) { + lInfo() << log().arg("Search result received : Safe Connection =") << mModelConnection.get(); + lInfo() << log().arg("this =") << this; auto *contacts = new QList>(); auto ldapContacts = ToolModel::getLdapFriendList(); auto core = CoreModel::getInstance()->getCore(); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index f742aa611..9517d1ef1 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -4377,7 +4377,7 @@ Error MagicSearchList - + device_id Telefon diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index e0cca6a92..0d8805fc4 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -4309,7 +4309,7 @@ Expiration : %1 MagicSearchList - + device_id Phone diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 5c3d9b245..e08abaf9d 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -4284,7 +4284,7 @@ Expiration : %1 MagicSearchList - + device_id Téléphone diff --git a/Linphone/model/chat/message/ChatMessageModel.cpp b/Linphone/model/chat/message/ChatMessageModel.cpp index ac09cb6da..d1a81c12f 100644 --- a/Linphone/model/chat/message/ChatMessageModel.cpp +++ b/Linphone/model/chat/message/ChatMessageModel.cpp @@ -37,6 +37,7 @@ ChatMessageModel::ChatMessageModel(const std::shared_ptr mEphemeralTimer.setInterval(60); mEphemeralTimer.setSingleShot(false); if (mMonitor->getEphemeralExpireTime() != 0) mEphemeralTimer.start(); + mChatRoom = mMonitor->getChatRoom(); connect(&mEphemeralTimer, &QTimer::timeout, this, [this] { emit ephemeralMessageTimeUpdated(mMonitor, mMonitor->getEphemeralExpireTime()); }); connect(this, &ChatMessageModel::ephemeralMessageTimerStarted, this, [this] { mEphemeralTimer.start(); }); @@ -47,7 +48,8 @@ ChatMessageModel::ChatMessageModel(const std::shared_ptr // We need to force this signal sending because there is no callback to know when a message has been read connect(CoreModel::getInstance().get(), &CoreModel::chatRoomRead, this, [this](const std::shared_ptr &core, const std::shared_ptr &chatRoom) { - if (chatRoom == mMonitor->getChatRoom()) { + if (!mMonitor || !mChatRoom.lock()) return; + if (chatRoom == mChatRoom.lock()) { if (mMonitor->isRead()) { emit messageRead(mMonitor); }