comparison plugins/mod_motd.lua @ 6010:fad7084a0b35

Merge 0.9->0.10
author Kim Alvefur <zash@zash.se>
date Thu, 06 Feb 2014 10:48:41 +0100
parents bd0ff8ae98a8 1579b53351e2
children e20c27e04ecc
comparison
equal deleted inserted replaced
6007:ff24bc2d41a6 6010:fad7084a0b35
13 13
14 if not motd_text then return; end 14 if not motd_text then return; end
15 15
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%s+", "\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/bare", function (event) 20 module:hook("presence/bare", function (event)
21 local session, stanza = event.origin, event.stanza; 21 local session, stanza = event.origin, event.stanza;
22 if session.username and not session.presence 22 if session.username and not session.presence
23 and not stanza.attr.type and not stanza.attr.to then 23 and not stanza.attr.type and not stanza.attr.to then