Commit 31fccce3 authored by Sébastien Blin's avatar Sébastien Blin Committed by Andreas Traczyk

conversationmodel: add options to remove a conversation

Change-Id: If1321507bd0fa3ce437704b6c08759fffa7b7a6f
Gitlab: #424Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 942d102e
...@@ -287,6 +287,13 @@ CallWidget::setupSmartListContextMenu(const QPoint& pos) ...@@ -287,6 +287,13 @@ CallWidget::setupSmartListContextMenu(const QPoint& pos)
[convUid]() { [convUid]() {
LRCInstance::getCurrentConversationModel()->clearHistory(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 // block contact
auto blockContactAction = new QAction(tr("Block contact"), this); auto blockContactAction = new QAction(tr("Block contact"), this);
menu.addAction(blockContactAction); menu.addAction(blockContactAction);
...@@ -541,7 +548,7 @@ void CallWidget::slotBlockInviteClicked(const QModelIndex & index) ...@@ -541,7 +548,7 @@ void CallWidget::slotBlockInviteClicked(const QModelIndex & index)
void CallWidget::slotIgnoreInviteClicked(const QModelIndex & index) void CallWidget::slotIgnoreInviteClicked(const QModelIndex & index)
{ {
auto convUid = index.data(static_cast<int>(SmartListModel::Role::UID)).value<QString>(); 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) void CallWidget::slotCustomContextMenuRequested(const QPoint& pos)
......
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