aboutsummaryrefslogtreecommitdiff
path: root/plugins/openpgp/src/stream_module.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-09-05 23:53:18 +0200
committerfiaxh <git@mx.ax.lt>2017-09-06 00:15:18 +0200
commit8944029128e3d0f9e32b61e00e880d92fceabb31 (patch)
tree8cf872969d3349c61278b19273e76c65036c429d /plugins/openpgp/src/stream_module.vala
parent312372350e24d1ebd8afbb0029fac04f2b64eb83 (diff)
downloaddino-8944029128e3d0f9e32b61e00e880d92fceabb31.tar.gz
dino-8944029128e3d0f9e32b61e00e880d92fceabb31.zip
Move encryption menu into ChatInput, PGP support for MUCs
Diffstat (limited to 'plugins/openpgp/src/stream_module.vala')
-rw-r--r--plugins/openpgp/src/stream_module.vala7
1 files changed, 5 insertions, 2 deletions
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<string> 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)]";