Commit 66c7cd61 authored by Nicolas Jager's avatar Nicolas Jager Committed by Anthony Léonard

rename newUnreadMessage to newInteraction

- newUnreadMessage was used only for messages. It will soon be used for
  data transfer.

- WARNING : all lrc clients need to be updated

Change-Id: Ie7b48767b36ea449c2405d796ed6faa6ea02ba51
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent 35a50e59
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment