From 749edd21b905006557cef593c2ded9284fb19313 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 22 Oct 2017 17:24:16 +0200 Subject: Add oob tag to http-upload messages fixes #166 --- xmpp-vala/CMakeLists.txt | 1 + xmpp-vala/src/module/xep/0066_out_of_band_data.vala | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 xmpp-vala/src/module/xep/0066_out_of_band_data.vala (limited to 'xmpp-vala') diff --git a/xmpp-vala/CMakeLists.txt b/xmpp-vala/CMakeLists.txt index 3306cf7e..3c747bea 100644 --- a/xmpp-vala/CMakeLists.txt +++ b/xmpp-vala/CMakeLists.txt @@ -51,6 +51,7 @@ SOURCES "src/module/xep/0049_private_xml_storage.vala" "src/module/xep/0054_vcard/module.vala" "src/module/xep/0060_pubsub.vala" + "src/module/xep/0066_out_of_band_data.vala" "src/module/xep/0082_date_time_profiles.vala" "src/module/xep/0084_user_avatars.vala" "src/module/xep/0085_chat_state_notifications.vala" diff --git a/xmpp-vala/src/module/xep/0066_out_of_band_data.vala b/xmpp-vala/src/module/xep/0066_out_of_band_data.vala new file mode 100644 index 00000000..b482252b --- /dev/null +++ b/xmpp-vala/src/module/xep/0066_out_of_band_data.vala @@ -0,0 +1,11 @@ +using Xmpp.Core; + +namespace Xmpp.Xep.OutOfBandData { + +public const string NS_URI = "jabber:x:oob"; + +public static void add_url_to_message(Message.Stanza message, string url, string? desc = null) { + message.stanza.put_node(new StanzaNode.build("x", NS_URI).add_self_xmlns().put_node(new StanzaNode.build("url", NS_URI).put_node(new StanzaNode.text(url)))); +} + +} -- cgit v1.2.3-70-g09d2