xmpp-vala/src/module/xep/0367_message_attaching.vala
raw| 1 | namespace Xmpp.Xep.MessageAttaching { |
| 2 | public const string NS_URI = "urn:xmpp:message-attaching:1"; |
| 3 | |
| 4 | public static string? get_attach_to(StanzaNode node) { |
| 5 | StanzaNode? attach_to = node.get_subnode("attach-to", NS_URI); |
| 6 | if (attach_to == null) return null; |
| 7 | |
| 8 | return attach_to.get_attribute("id", NS_URI); |
| 9 | } |
| 10 | |
| 11 | public static StanzaNode to_stanza_node(string id) { |
| 12 | return new StanzaNode.build("attach-to", NS_URI).add_self_xmlns() |
| 13 | .put_attribute("id", id, NS_URI); |
| 14 | } |
| 15 | } |