aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/ui
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-06-17 14:30:46 +0200
committerfiaxh <git@lightrise.org>2020-06-23 15:54:12 +0200
commit886a519d8543cba45792a08210093c851f20a2a0 (patch)
tree639180b362b79518e0ea0523c39ae7fe36877cd6 /plugins/omemo/src/ui
parent6d41071da1f01678b9ab449ed7f00391067da43a (diff)
downloaddino-886a519d8543cba45792a08210093c851f20a2a0.tar.gz
dino-886a519d8543cba45792a08210093c851f20a2a0.zip
Don't offer encryption in MUC PMs
Diffstat (limited to 'plugins/omemo/src/ui')
-rw-r--r--plugins/omemo/src/ui/bad_messages_populator.vala3
-rw-r--r--plugins/omemo/src/ui/encryption_list_entry.vala5
2 files changed, 8 insertions, 0 deletions
diff --git a/plugins/omemo/src/ui/bad_messages_populator.vala b/plugins/omemo/src/ui/bad_messages_populator.vala
index b8f38434..5a881c25 100644
--- a/plugins/omemo/src/ui/bad_messages_populator.vala
+++ b/plugins/omemo/src/ui/bad_messages_populator.vala
@@ -37,6 +37,9 @@ public class BadMessagesPopulator : Plugins.ConversationItemPopulator, Plugins.C
}
private void init_state() {
+
+ if (current_conversation.type_ == Conversation.Type.GROUPCHAT_PM) return;
+
var qry = db.identity_meta.select()
.join_with(db.identity, db.identity.id, db.identity_meta.identity_id)
.with(db.identity.account_id, "=", current_conversation.account.id)
diff --git a/plugins/omemo/src/ui/encryption_list_entry.vala b/plugins/omemo/src/ui/encryption_list_entry.vala
index aaec517f..a0e6bb0f 100644
--- a/plugins/omemo/src/ui/encryption_list_entry.vala
+++ b/plugins/omemo/src/ui/encryption_list_entry.vala
@@ -1,3 +1,4 @@
+using Dino.Entities;
using Gtk;
using Qlite;
using Xmpp;
@@ -42,6 +43,10 @@ public class EncryptionListEntry : Plugins.EncryptionListEntry, Object {
}
public async void encryption_activated_async(Entities.Conversation conversation, Plugins.SetInputFieldStatus input_status_callback) {
+ if (conversation.type_ == Conversation.Type.GROUPCHAT_PM) {
+ input_status_callback(new Plugins.InputFieldStatus("Can't use encryption in a groupchat private message.", Plugins.InputFieldStatus.MessageType.ERROR, Plugins.InputFieldStatus.InputState.NO_SEND));
+ return;
+ }
MucManager muc_manager = plugin.app.stream_interactor.get_module(MucManager.IDENTITY);
Manager omemo_manager = plugin.app.stream_interactor.get_module(Manager.IDENTITY);