Comparison

plugins/mod_motd.lua @ 9791:ca0473cadd1c 0.11

mod_motd: Remove unused variable [luacheck]
author Kim Alvefur <zash@zash.se>
date Thu, 17 Jan 2019 01:15:29 +0100
parent 9789:abd32bc33a9c
child 12977:74b9e05af71e
comparison
equal deleted inserted replaced
9789:abd32bc33a9c 9791:ca0473cadd1c
16 local st = require "util.stanza"; 16 local st = require "util.stanza";
17 17
18 motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n[ \t]+", "\n"); -- Strip indentation from the config 18 motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n[ \t]+", "\n"); -- Strip indentation from the config
19 19
20 module:hook("presence/initial", function (event) 20 module:hook("presence/initial", function (event)
21 local session, stanza = event.origin, event.stanza; 21 local session = event.origin;
22 local motd_stanza = 22 local motd_stanza =
23 st.message({ to = session.full_jid, from = motd_jid }) 23 st.message({ to = session.full_jid, from = motd_jid })
24 :tag("body"):text(motd_text); 24 :tag("body"):text(motd_text);
25 module:send(motd_stanza); 25 module:send(motd_stanza);
26 module:log("debug", "MOTD send to user %s", session.full_jid); 26 module:log("debug", "MOTD send to user %s", session.full_jid);