Skip to content
Snippets Groups Projects
Commit 467ec757 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Kateryna Kostiuk
Browse files

convsersationmodel: add getConversation


Change-Id: If21cc0585152def69a3dd8be73fef01f834505b3
Reviewed-by: default avatarKateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
parent ddb489af
No related branches found
No related tags found
No related merge requests found
...@@ -79,6 +79,12 @@ public: ...@@ -79,6 +79,12 @@ public:
* @return conversations filtered * @return conversations filtered
*/ */
const ConversationQueue& getFilteredConversations(const profile::Type& filter = profile::Type::INVALID, bool forceUpdate = false, const bool includeBanned = false) const; const ConversationQueue& getFilteredConversations(const profile::Type& filter = profile::Type::INVALID, bool forceUpdate = false, const bool includeBanned = false) const;
/**
* Get a conversation copy
* @param uid of the conversation
* @return a copy of the conversation
*/
const conversation::Info getConversation(const std::string& uid) const;
/** /**
* Get the conversation at row in the filtered conversations * Get the conversation at row in the filtered conversations
* @param row * @param row
......
...@@ -346,6 +346,19 @@ ConversationModel::getFilteredConversations(const profile::Type& filter, bool fo ...@@ -346,6 +346,19 @@ ConversationModel::getFilteredConversations(const profile::Type& filter, bool fo
return pimpl_->customFilteredConversations; return pimpl_->customFilteredConversations;
} }
const conversation::Info
ConversationModel::getConversation(const std::string& uid) const
{
auto row = pimpl_->indexOf(uid);
if (row >= pimpl_->conversations.size())
return conversation::Info();
auto conversationInfo = pimpl_->conversations.at(row);
conversationInfo.unreadMessages = pimpl_->getNumberOfUnreadMessagesFor(conversationInfo.uid);
return conversationInfo;
}
conversation::Info conversation::Info
ConversationModel::filteredConversation(const unsigned int row) const ConversationModel::filteredConversation(const unsigned int row) const
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment