From 8944029128e3d0f9e32b61e00e880d92fceabb31 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 5 Sep 2017 23:53:18 +0200 Subject: Move encryption menu into ChatInput, PGP support for MUCs --- plugins/openpgp/src/stream_module.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/openpgp/src/stream_module.vala') diff --git a/plugins/openpgp/src/stream_module.vala b/plugins/openpgp/src/stream_module.vala index 745f2005..6c55cdc5 100644 --- a/plugins/openpgp/src/stream_module.vala +++ b/plugins/openpgp/src/stream_module.vala @@ -33,8 +33,11 @@ namespace Dino.Plugins.OpenPgp { } } - public bool encrypt(Message.Stanza message, string key_id) { - string? enc_body = gpg_encrypt(message.body, new string[] {key_id, own_key.fpr}); + public bool encrypt(Message.Stanza message, Gee.List fprs) { + string[] encrypt_to = new string[fprs.size + 1]; + for (int i = 0; i < fprs.size; i++) encrypt_to[i] = fprs[i]; + encrypt_to[encrypt_to.length - 1] = own_key.fpr; + string? enc_body = gpg_encrypt(message.body, encrypt_to); if (enc_body != null) { message.stanza.put_node(new StanzaNode.build("x", NS_URI_ENCRYPTED).add_self_xmlns().put_node(new StanzaNode.text(enc_body))); message.body = "[This message is OpenPGP encrypted (see XEP-0027)]"; -- cgit v1.2.3-54-g00ecf