aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0367_message_attaching.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/xep/0367_message_attaching.vala')
-rw-r--r--xmpp-vala/src/module/xep/0367_message_attaching.vala15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/xep/0367_message_attaching.vala b/xmpp-vala/src/module/xep/0367_message_attaching.vala
new file mode 100644
index 00000000..7441cd19
--- /dev/null
+++ b/xmpp-vala/src/module/xep/0367_message_attaching.vala
@@ -0,0 +1,15 @@
+namespace Xmpp.Xep.MessageAttaching {
+ public const string NS_URI = "urn:xmpp:message-attaching:1";
+
+ public static string? get_attach_to(StanzaNode node) {
+ StanzaNode? attach_to = node.get_subnode("attach-to", NS_URI);
+ if (attach_to == null) return null;
+
+ return attach_to.get_attribute("id", NS_URI);
+ }
+
+ public static StanzaNode to_stanza_node(string id) {
+ return new StanzaNode.build("attach-to", NS_URI).add_self_xmlns()
+ .put_attribute("id", id, NS_URI);
+ }
+} \ No newline at end of file