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..c5ac51cc1 100644 --- a/Linphone/core/search/MagicSearchList.cpp +++ b/Linphone/core/search/MagicSearchList.cpp @@ -92,6 +92,9 @@ void MagicSearchList::setSelf(const QSharedPointer &me) { mModelConnection->makeConnectToModel( &MagicSearchModel::searchResultsReceived, [this](const std::list> &results) { + lInfo() << log().arg("Search result received"); + lInfo() << log().arg("this =") << this; + lInfo() << log().arg("Safe Connection =") << mModelConnection.get(); 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 62fe7120b..ddcdc28ae 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -4362,7 +4362,7 @@ Ablauf: %1 MagicSearchList - + device_id Telefon diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 1c28060db..0868d4d70 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -4260,7 +4260,7 @@ Expiration : %1 MagicSearchList - + device_id Phone diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index ddc286115..bb3004257 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -4235,7 +4235,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 733768f2a..14647f327 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); }