comparison mod_http_muc_log/mod_http_muc_log.lua @ 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 a9fa98e28697
children cefc375d0929
comparison
equal deleted inserted replaced
3063:a9fa98e28697 3064:ce61f1826f1f
66 return false; 66 return false;
67 end 67 end
68 68
69 return true; 69 return true;
70 end 70 end
71
72 module:hook("muc-disco#info", function (event)
73 local room = event.room;
74 if open_room(room) then
75 table.insert(event.form, { name = "muc#roominfo_logs", type="text-single" });
76 event.formdata["muc#roominfo_logs"] = module:http_url() .. "/" .. get_link(jid_split(event.room.jid), nil);
77 end
78 end);
71 79
72 local function sort_Y(a,b) return a.year > b.year end 80 local function sort_Y(a,b) return a.year > b.year end
73 local function sort_m(a,b) return a.n > b.n end 81 local function sort_m(a,b) return a.n > b.n end
74 82
75 -- Time zone hack? 83 -- Time zone hack?