Commit 8412f818 authored by Amin Bandali's avatar Amin Bandali

swarm: disable clearing history for swarm conversations

GitLab: #1268
Change-Id: I9c16edebd1e39f1c4e0a8d2f92d37f430ffe6f6b
parent 31fc7e9c
......@@ -245,9 +245,11 @@ update(GtkTreeSelection *selection, ConversationPopupMenu *self)
g_signal_connect(block_conversation_item, "activate", G_CALLBACK(block_conversation), priv);
}
} else {
auto rm_history_conversation = gtk_menu_item_new_with_mnemonic(_("C_lear history"));
gtk_menu_shell_append(GTK_MENU_SHELL(self), rm_history_conversation);
g_signal_connect(rm_history_conversation, "activate", G_CALLBACK(remove_history_conversation), priv);
if (!conv.isSwarm()) {
auto rm_history_conversation = gtk_menu_item_new_with_mnemonic(_("C_lear history"));
gtk_menu_shell_append(GTK_MENU_SHELL(self), rm_history_conversation);
g_signal_connect(rm_history_conversation, "activate", G_CALLBACK(remove_history_conversation), priv);
}
auto rm_conversation_item = gtk_menu_item_new_with_mnemonic(_("_Remove conversation"));
gtk_menu_shell_append(GTK_MENU_SHELL(self), rm_conversation_item);
g_signal_connect(rm_conversation_item, "activate", G_CALLBACK(remove_conversation), priv);
......
......@@ -2786,11 +2786,13 @@ main_window_clear_history(MainWindow *win)
g_return_if_fail(priv && priv->cpp && priv->cpp->accountInfo_);
priv->cpp->forCurrentConversation([&](const auto &conversation) {
auto res = priv->cpp->showOkCancelDialog(
_("Clear history"),
_("Do you really want to clear the history of this conversation?"));
if (!res) return;
priv->cpp->accountInfo_->conversationModel->clearHistory(conversation.uid);
if (!conversation.isSwarm()) {
auto res = priv->cpp->showOkCancelDialog(
_("Clear history"),
_("Do you really want to clear the history of this conversation?"));
if (!res) return;
priv->cpp->accountInfo_->conversationModel->clearHistory(conversation.uid);
}
});
}
......
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