From e3e4de0fe7adf0800c91d5c2a601f298d3b6c3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Tue, 18 Jul 2023 12:00:54 -0400 Subject: [PATCH] misc: remove unused method Change-Id: Ib58dabb342a293a1e4e699fcb75b1b04e5541bc4 --- src/libclient/api/conversationmodel.h | 6 ---- src/libclient/conversationmodel.cpp | 49 --------------------------- 2 files changed, 55 deletions(-) diff --git a/src/libclient/api/conversationmodel.h b/src/libclient/api/conversationmodel.h index 367ada7ba..1e353934e 100644 --- a/src/libclient/api/conversationmodel.h +++ b/src/libclient/api/conversationmodel.h @@ -258,12 +258,6 @@ public: * @param uid of the conversation */ void clearHistory(const QString& uid); - /** - * change the status of the interaction from UNREAD to READ - * @param convId, id of the conversation - * @param msgId, id of the interaction - */ - void setInteractionRead(const QString& convId, const QString& msgId); /** * Clears the unread text messages of a conversation * @param convId, uid of the conversation diff --git a/src/libclient/conversationmodel.cpp b/src/libclient/conversationmodel.cpp index e539397d2..8ca0d219d 100644 --- a/src/libclient/conversationmodel.cpp +++ b/src/libclient/conversationmodel.cpp @@ -1623,55 +1623,6 @@ ConversationModel::clearAllHistory() Q_EMIT modelChanged(); } -void -ConversationModel::setInteractionRead(const QString& convId, const QString& interactionId) -{ - auto conversationIdx = pimpl_->indexOf(convId); - if (conversationIdx == -1) { - return; - } - bool emitUpdated = false; - { - std::lock_guard<std::mutex> lk(pimpl_->interactionsLocks[convId]); - auto& interactions = pimpl_->conversations[conversationIdx].interactions; - auto it = interactions->find(interactionId); - if (it != interactions->end()) { - emitUpdated = true; - if (it->second.isRead) { - return; - } - it->second.isRead = true; - interactions->emitDataChanged(it, {MessageList::Role::IsRead}); - if (pimpl_->conversations[conversationIdx].unreadMessages != 0) - pimpl_->conversations[conversationIdx].unreadMessages -= 1; - } - } - if (emitUpdated) { - pimpl_->invalidateModel(); - if (pimpl_->conversations[conversationIdx].isSwarm()) { - ConfigurationManager::instance().setMessageDisplayed(owner.id, - "swarm:" + convId, - interactionId, - 3); - } else { - auto daemonId = storage::getDaemonIdByInteractionId(pimpl_->db, interactionId); - if (owner.profileInfo.type != profile::Type::SIP) { - ConfigurationManager::instance() - .setMessageDisplayed(owner.id, - "jami:" - + pimpl_ - ->peersForConversation( - pimpl_->conversations[conversationIdx]) - .front(), - daemonId, - 3); - } - storage::setInteractionRead(pimpl_->db, interactionId); - } - Q_EMIT pimpl_->behaviorController.newReadInteraction(owner.id, convId, interactionId); - } -} - void ConversationModel::clearUnreadInteractions(const QString& convId) { -- GitLab