diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index abd9eb5380fa8374ef6b7a54e8a255c3659f2392..1e865019cf469ea1e48d58fbf98243b14cf445e4 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -95,9 +95,12 @@ void ChatRoomPrivate::sendIsComposingNotification() { void ChatRoomPrivate::addEvent(const shared_ptr<EventLog> &eventLog) { L_Q(); - q->getCore()->getPrivate()->mainDb->addEvent(eventLog); - EventLog::Type type = eventLog->getType(); + + if (!q->getCore()->getPrivate()->mainDb->addEvent(eventLog)) { + lWarning() << "Failed to add event of type " << type << " to the database"; + } + if (type == EventLog::Type::ConferenceParticipantDeviceAdded || type == EventLog::Type::ConferenceParticipantDeviceRemoved || type == EventLog::Type::ConferenceParticipantDeviceStatusChanged) { diff --git a/src/chat/chat-room/server-group-chat-room.cpp b/src/chat/chat-room/server-group-chat-room.cpp index 187af9fb1bed0b702ca30098afbc4f3728b5f24e..7e5f6b9b6ee4e395b1f630d53eda9f24e01795ba 100644 --- a/src/chat/chat-room/server-group-chat-room.cpp +++ b/src/chat/chat-room/server-group-chat-room.cpp @@ -1165,7 +1165,7 @@ void ServerGroupChatRoomPrivate::queueMessage(const shared_ptr<Message> &msg) { for (const auto &participant : q->getParticipants()) { for (const auto &device : participant->getDevices()) { // Queue the message for all devices except the one that sent it - if (!msg->fromAddr->weakEqual(*device->getAddress())) { + if (*msg->fromAddr != *device->getAddress()) { queueMessage(msg, device->getAddress()); } } diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index f09bbfdbf14b0960f826fe63b0848f1422e4a31a..3d0e5b60fb0c8fcf297ab4013e8338efa2128192 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -1468,9 +1468,7 @@ void MainDbPrivate::updateConferenceChatMessageEvent(const shared_ptr<EventLog> ? dbState : state); const int markedAsReadInt = markedAsRead ? 1 : 0; - *session << "UPDATE conference_chat_message_event SET state = :state, imdn_message_id = " - ":imdnMessageId, marked_as_read = :markedAsRead" - " WHERE event_id = :eventId", + *session << "UPDATE conference_chat_message_event SET state = :state, imdn_message_id = :imdnMessageId, marked_as_read = :markedAsRead WHERE event_id = :eventId", soci::use(stateInt), soci::use(imdnMessageId), soci::use(markedAsReadInt), soci::use(eventId); } @@ -3659,7 +3657,6 @@ void MainDb::initCleanup() { bool MainDb::addEvent(const shared_ptr<EventLog> &eventLog) { #ifdef HAVE_DB_STORAGE - if (!isInitialized()) { lWarning() << "Database has not been initialized"; return false;