aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0380_explicit_encryption.vala
blob: 710da92db3692f3a40732bae5384438366b493d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
namespace Xmpp.Xep.ExplicitEncryption {
public const string NS_URI = "urn:xmpp:eme:0";

public static void add_encryption_tag_to_message(MessageStanza message, string ns, string? name = null) {
    StanzaNode encryption = new StanzaNode.build("encryption", NS_URI).add_self_xmlns()
        .put_attribute("namespace", ns);

    if(name != null)
        encryption.put_attribute("name", name);

    message.stanza.put_node(encryption);
}
    
}