Skip to content
Snippets Groups Projects
Commit 8c85ae00 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

conversationfacade: use removeContact for one to one conversations

Change-Id: I7cc80ce64a818cb8801ed56da6e348ba5c7f5bf3
GitLab: https://git.jami.net/savoirfairelinux/ring-project/-/issues/1282
parent 4dadda43
No related branches found
No related tags found
No related merge requests found
......@@ -693,7 +693,17 @@ public class ConversationFacade {
public Completable removeConversation(String accountId, Uri conversationUri) {
if (conversationUri.isSwarm()) {
// For a one to one conversation, contact is strongly related, so remove the contact.
// This will remove related conversations
Account account = mAccountService.getAccount(accountId);
Conversation conversation = account.getSwarm(conversationUri.getRawRingId());
if (conversation != null && conversation.getMode().blockingFirst() == Conversation.Mode.OneToOne) {
Contact contact = conversation.getContact();
mAccountService.removeContact(accountId, contact.getUri().getRawRingId(), false);
return Completable.complete();
} else {
return mAccountService.removeConversation(accountId, conversationUri);
}
} else {
return mHistoryService
.clearHistory(conversationUri.getUri(), accountId, true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment