Skip to content
Snippets Groups Projects
Commit 9d500e78 authored by François-Simon Fauteux-Chapleau's avatar François-Simon Fauteux-Chapleau
Browse files

conversation_module: don't update removed conversations

When removing a contact, we need to set the "removed" timestamp for our
active conversations with that contact, but we shouldn't update the
timestamp for conversations that had already been removed in the past.

GitLab: #1048
Change-Id: Ic090775625fa8fb557e3081ec408ee10bf01aaff
parent b493c7e8
Branches
No related tags found
No related merge requests found
...@@ -2859,12 +2859,14 @@ ConversationModule::removeContact(const std::string& uri, bool banned) ...@@ -2859,12 +2859,14 @@ ConversationModule::removeContact(const std::string& uri, bool banned)
auto removeConvInfo = [&](const auto& conv, const auto& members) { auto removeConvInfo = [&](const auto& conv, const auto& members) {
if ((isSelf && members.size() == 1) if ((isSelf && members.size() == 1)
|| (!isSelf && std::find(members.begin(), members.end(), uri) != members.end())) { || (!isSelf && std::find(members.begin(), members.end(), uri) != members.end())) {
// Mark as removed // Mark the conversation as removed if it wasn't already
if (!conv->info.isRemoved()) {
conv->info.removed = std::time(nullptr); conv->info.removed = std::time(nullptr);
updateClient(conv->info.id); updateClient(conv->info.id);
pimpl_->addConvInfo(conv->info); pimpl_->addConvInfo(conv->info);
return true; return true;
} }
}
return false; return false;
}; };
{ {
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment