Changeset

3064:ce61f1826f1f

mod_http_muc_log: Include URL in disco#info for public rooms
author Kim Alvefur <zash@zash.se>
date Tue, 29 May 2018 04:36:56 +0200
parents 3063:a9fa98e28697
children 3065:49254b9cc751
files mod_http_muc_log/mod_http_muc_log.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_muc_log/mod_http_muc_log.lua	Mon May 28 20:55:22 2018 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Tue May 29 04:36:56 2018 +0200
@@ -69,6 +69,14 @@
 	return true;
 end
 
+module:hook("muc-disco#info", function (event)
+	local room = event.room;
+	if open_room(room) then
+		table.insert(event.form, { name = "muc#roominfo_logs", type="text-single" });
+		event.formdata["muc#roominfo_logs"] = module:http_url() .. "/" .. get_link(jid_split(event.room.jid), nil);
+	end
+end);
+
 local function sort_Y(a,b) return a.year > b.year end
 local function sort_m(a,b) return a.n > b.n end