Merge branch 'fix/6.1' into 'release/6.1'

Fix/6.1

See merge request BC/public/linphone-desktop!1655
This commit is contained in:
Gaëlle Braud 2026-01-22 14:58:46 +00:00
commit ce707017df
5 changed files with 11 additions and 10 deletions

View file

@ -43,7 +43,7 @@ QSharedPointer<ChatCore> ChatCore::create(const std::shared_ptr<linphone::ChatRo
}
ChatCore::ChatCore(const std::shared_ptr<linphone::ChatRoom> &chatRoom) : QObject(nullptr) {
// lDebug() << "[ChatCore] new" << this;
lDebug() << "[ChatCore] new" << this;
mustBeInLinphoneThread(getClassName());
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
mLastUpdatedTime = QDateTime::fromSecsSinceEpoch(chatRoom->getLastUpdateTime());
@ -211,7 +211,7 @@ void ChatCore::setSelf(QSharedPointer<ChatCore> me) {
const std::shared_ptr<const linphone::EventLog> &eventLog) {
if (mChatModel->getMonitor() != chatRoom) return;
if (!eventLog) return;
lDebug() << "EVENT LOG RECEIVED IN CHATROOM" << mChatModel->getTitle();
lDebug() << log().arg("EVENT LOG RECEIVED IN CHATROOM") << this << mChatModel->getTitle();
auto event = EventLogCore::create(eventLog, chatRoom);
if (event->isHandled()) {
mChatModelConnection->invokeToCore([this, event]() { emit eventsInserted({event}); });
@ -224,7 +224,7 @@ void ChatCore::setSelf(QSharedPointer<ChatCore> me) {
&ChatModel::chatMessagesReceived, [this](const std::shared_ptr<linphone::ChatRoom> &chatRoom,
const std::list<std::shared_ptr<linphone::EventLog>> &eventsLog) {
if (mChatModel->getMonitor() != chatRoom) return;
lDebug() << "CHAT MESSAGE RECEIVED IN CHATROOM" << mChatModel->getTitle();
lDebug() << log().arg("CHAT MESSAGE RECEIVED IN CHATROOM") << this << mChatModel->getTitle();
QList<QSharedPointer<EventLogCore>> list;
for (auto &e : eventsLog) {
auto event = EventLogCore::create(e, chatRoom);

View file

@ -130,6 +130,7 @@ void ChatList::setSelf(QSharedPointer<ChatList> me) {
}
endResetModel();
setIsUpdating(false);
chats->clear();
delete chats;
});
});

View file

@ -1592,7 +1592,7 @@ VariantObject *Utils::getCurrentCallChat(CallGui *call) {
auto linphoneChatRoom = ToolModel::lookupCurrentCallChat(callModel);
if (linphoneChatRoom) {
auto chatCore = ChatCore::create(linphoneChatRoom);
return QVariant::fromValue(new ChatGui(chatCore));
return chatCore ? QVariant::fromValue(new ChatGui(chatCore)) : QVariant();
} else {
// Only try to create chatroom if 1-1 call
if (!callModel->getConference()) {
@ -1603,7 +1603,7 @@ VariantObject *Utils::getCurrentCallChat(CallGui *call) {
lInfo() << "[Utils] Chatroom created with" << callModel->getRemoteAddress()->asStringUriOnly();
auto id = linphoneChatRoom->getIdentifier();
auto chatCore = ChatCore::create(linphoneChatRoom);
return QVariant::fromValue(new ChatGui(chatCore));
return chatCore ? QVariant::fromValue(new ChatGui(chatCore)) : QVariant();
} else {
lWarning() << "[Utils] Failed to create 1-1 conversation with"
<< callModel->getRemoteAddress()->asStringUriOnly() << "!";
@ -1625,14 +1625,14 @@ VariantObject *Utils::getChatForAddress(QString address) {
auto linphoneChatRoom = ToolModel::lookupChatForAddress(linAddr);
if (linphoneChatRoom) {
auto chatCore = ChatCore::create(linphoneChatRoom);
return QVariant::fromValue(new ChatGui(chatCore));
return chatCore ? QVariant::fromValue(new ChatGui(chatCore)) : QVariant();
} else {
lInfo() << "[Utils] Did not find existing chat room, create one";
linphoneChatRoom = ToolModel::createChatForAddress(linAddr);
if (linphoneChatRoom != nullptr) {
lInfo() << "[Utils] Chatroom created with" << linAddr->asStringUriOnly();
auto chatCore = ChatCore::create(linphoneChatRoom);
return QVariant::fromValue(new ChatGui(chatCore));
return chatCore ? QVariant::fromValue(new ChatGui(chatCore)) : QVariant();
} else {
lWarning() << "[Utils] Failed to create 1-1 conversation with" << linAddr->asStringUriOnly() << "!";
//: Failed to create 1-1 conversation with %1 !
@ -1662,7 +1662,7 @@ VariantObject *Utils::createGroupChat(QString subject, QStringList participantAd
auto linphoneChatRoom = ToolModel::createGroupChatRoom(subject, addresses);
if (linphoneChatRoom) {
auto chatCore = ChatCore::create(linphoneChatRoom);
return QVariant::fromValue(new ChatGui(chatCore));
return chatCore ? QVariant::fromValue(new ChatGui(chatCore)) : QVariant();
} else {
return QVariant();
}

View file

@ -60,7 +60,7 @@ ListView {
}
}
onChatAdded: (chat) => {
mainItem.chatToSelect = chat
// mainItem.chatToSelect = chat
}
onRowsRemoved: {
var index = mainItem.currentIndex

@ -1 +1 @@
Subproject commit 3a8181af1898277b8e5c5ec8aedc2b1486c43a7f
Subproject commit bdad782f357e74a3a23562b257af6c4d58ad5e3f