aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-01-17 01:09:38 +0100
committerKim Alvefur <zash@zash.se>2019-01-17 01:09:38 +0100
commit06e29c834c2713c13000e3cf11f08ba7df239178 (patch)
tree49240ef320cc0bdd0d6a974125e16e7a99ccdbb0 /plugins
parent5268b2c180c1bce00117232541a979a909ff2eb3 (diff)
parent30ab1bca8673be0e2e8370bf70990e88dc4b9fea (diff)
downloadprosody-06e29c834c2713c13000e3cf11f08ba7df239178.tar.gz
prosody-06e29c834c2713c13000e3cf11f08ba7df239178.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_motd.lua14
-rw-r--r--plugins/mod_presence.lua1
2 files changed, 7 insertions, 8 deletions
diff --git a/plugins/mod_motd.lua b/plugins/mod_motd.lua
index 13bc7e31..c68e77a8 100644
--- a/plugins/mod_motd.lua
+++ b/plugins/mod_motd.lua
@@ -18,12 +18,10 @@ local st = require "util.stanza";
motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n[ \t]+", "\n"); -- Strip indentation from the config
module:hook("presence/initial", function (event)
- local session, stanza = event.origin, event.stanza;
- if not stanza.attr.type and not stanza.attr.to then
- local motd_stanza =
- st.message({ to = session.full_jid, from = motd_jid })
- :tag("body"):text(motd_text);
- module:send(motd_stanza);
- module:log("debug", "MOTD send to user %s", session.full_jid);
- end
+ local session, stanza = event.origin, event.stanza;
+ local motd_stanza =
+ st.message({ to = session.full_jid, from = motd_jid })
+ :tag("body"):text(motd_text);
+ module:send(motd_stanza);
+ module:log("debug", "MOTD send to user %s", session.full_jid);
end, 1);
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 5aed5854..f7f458ca 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -63,6 +63,7 @@ function handle_normal_presence(origin, stanza)
core_post_stanza(origin, stanza, true);
end
end
+ stanza.attr.to = nil;
if stanza.attr.type == nil and not origin.presence then -- initial presence
module:fire_event("presence/initial", { origin = origin, stanza = stanza } );
origin.presence = stanza; -- FIXME repeated later