2017-10-22 15:24:16 +00:00
|
|
|
namespace Xmpp.Xep.OutOfBandData {
|
|
|
|
|
|
|
|
public const string NS_URI = "jabber:x:oob";
|
|
|
|
|
2018-01-12 20:03:09 +00:00
|
|
|
public static void add_url_to_message(MessageStanza message, string url, string? desc = null) {
|
2017-10-22 15:24:16 +00:00
|
|
|
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))));
|
|
|
|
}
|
|
|
|
|
2018-01-12 20:03:09 +00:00
|
|
|
public static string? get_url_from_message(MessageStanza message) {
|
2017-12-11 17:39:55 +00:00
|
|
|
return message.stanza.get_deep_string_content(NS_URI + ":x", NS_URI + ":url");
|
|
|
|
}
|
|
|
|
|
2017-10-22 15:24:16 +00:00
|
|
|
}
|