From 31fccce349e08e1b569fca326e5f55277ffc5075 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Thu, 13 Dec 2018 11:27:05 -0500
Subject: [PATCH] conversationmodel: add options to remove a conversation

Change-Id: If1321507bd0fa3ce437704b6c08759fffa7b7a6f
Gitlab: #424
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
---
 callwidget.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/callwidget.cpp b/callwidget.cpp
index a2d7daa..cd0283b 100644
--- a/callwidget.cpp
+++ b/callwidget.cpp
@@ -287,6 +287,13 @@ CallWidget::setupSmartListContextMenu(const QPoint& pos)
             [convUid]() {
                 LRCInstance::getCurrentConversationModel()->clearHistory(convUid);
             });
+        // remove contact
+        auto removeContactAction = new QAction(tr("Remove contact"), this);
+        menu.addAction(removeContactAction);
+        connect(removeContactAction, &QAction::triggered,
+            [convUid]() {
+                LRCInstance::getCurrentConversationModel()->removeConversation(convUid, false);
+            });
         // block contact
         auto blockContactAction = new QAction(tr("Block contact"), this);
         menu.addAction(blockContactAction);
@@ -541,7 +548,7 @@ void CallWidget::slotBlockInviteClicked(const QModelIndex & index)
 void CallWidget::slotIgnoreInviteClicked(const QModelIndex & index)
 {
     auto convUid = index.data(static_cast<int>(SmartListModel::Role::UID)).value<QString>();
-    LRCInstance::getCurrentConversationModel()->removeConversation(convUid.toStdString());
+    LRCInstance::getCurrentConversationModel()->removeConversation(convUid.toStdString(), false);
 }
 
 void CallWidget::slotCustomContextMenuRequested(const QPoint& pos)
-- 
GitLab