diff --git a/src/api/conversationmodel.h b/src/api/conversationmodel.h index 795604f7eb4dd03e8a0840af671028f66ab0b318..6a2a2af478030ad64a419c4c7ec27db56266768c 100644 --- a/src/api/conversationmodel.h +++ b/src/api/conversationmodel.h @@ -155,10 +155,11 @@ public: Q_SIGNALS: /** * Emitted when a conversation receives a new interaction - * @param uid of msg - * @param msg + * @param uid of conversation + * @param interactionId + * @param interactionInfo */ - void newUnreadMessage(const std::string& uid, uint64_t msgId, const interaction::Info& msg) const; // [jn] rendre cette fonction plus générique en remplaçant message par interaction + void newInteraction(const std::string& uid, uint64_t interactionId, const interaction::Info& interactionInfo) const; /** * Emitted when an interaction got a new status * @param convUid conversation which owns the interaction diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp index f1195270d67fe274ee3435e907cd1aa409c04d20..7f34fc70a502b5b02887339527ef46e3c3ac11c0 100644 --- a/src/conversationmodel.cpp +++ b/src/conversationmodel.cpp @@ -549,7 +549,7 @@ ConversationModel::sendMessage(const std::string& uid, const std::string& body) conversation.lastMessageUid = msgId; pimpl_->dirtyConversations = true; // Emit this signal for chatview in the client - emit newUnreadMessage(convId, msgId, msg); + emit newInteraction(convId, msgId, msg); // This conversation is now at the top of the list pimpl_->sortConversations(); // The order has changed, informs the client to redraw the list @@ -863,7 +863,7 @@ ConversationModelPimpl::slotPendingContactAccepted(const std::string& uri) auto conversationIdx = indexOf(conv[0]); conversations[conversationIdx].interactions.emplace(msgId, msg); dirtyConversations = true; - emit linked.newUnreadMessage(conv[0], msgId, msg); + emit linked.newInteraction(conv[0], msgId, msg); } catch (std::out_of_range& e) { qDebug() << "ConversationModelPimpl::slotContactAdded can't find contact"; } @@ -1073,7 +1073,7 @@ ConversationModelPimpl::addOrUpdateCallMessage(const std::string& callId, const } dirtyConversations = true; if (newInteraction) - emit linked.newUnreadMessage(conversation.uid, msgId, msg); + emit linked.newInteraction(conversation.uid, msgId, msg); else emit linked.interactionStatusUpdated(conversation.uid, msgId, msg); sortConversations(); @@ -1143,7 +1143,7 @@ ConversationModelPimpl::addIncomingMessage(const std::string& from, conversations[conversationIdx].lastMessageUid = msgId; } dirtyConversations = true; - emit linked.newUnreadMessage(conv[0], msgId, msg); + emit linked.newInteraction(conv[0], msgId, msg); sortConversations(); emit linked.modelSorted(); } @@ -1231,7 +1231,7 @@ ConversationModelPimpl::slotIncomingTransfer(const std::string& uid, const std::size_t size, const std::size_t offset) { - emit linked.newUnreadMessage("", -1, {}); + emit linked.newInteraction("", -1, {}); } void