changeset 3034:6e9096b66704

mod_pastebin: Add an OOB tag pointing to the pastebin URL
author Kim Alvefur <zash@zash.se>
date Mon, 21 May 2018 00:54:27 +0200
parents b2b129f699ed
children 60ca0d03f3e3
files mod_pastebin/mod_pastebin.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pastebin/mod_pastebin.lua	Sun May 20 18:11:15 2018 +0200
+++ b/mod_pastebin/mod_pastebin.lua	Mon May 21 00:54:27 2018 +0200
@@ -123,6 +123,8 @@
 		local summary_prefixed = summary:match("[,:]$");
 		replace_tag(stanza, st.stanza("body"):text(summary));
 
+		stanza:add_child(st.stanza("query", { xmlns = "jabber:iq:oob" }):tag("url"):text(url));
+
 		if html_preview then
 			local line_count = select(2, body:gsub("\n", "%0")) + 1;
 			local link_text = ("[view %spaste (%d line%s)]"):format(summary_prefixed and "" or "rest of ", line_count, line_count == 1 and "" or "s");