aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-10-26 13:06:08 +0200
committerKim Alvefur <zash@zash.se>2016-10-26 13:06:08 +0200
commite21979a2ea063ee32e56ade3ed470e7b6669c05a (patch)
tree7e5243fe2b89c164913efd9418bb7c7552eb63c6 /plugins
parentf1c2f29484997c0a953a248241768df1c3736df5 (diff)
downloadprosody-e21979a2ea063ee32e56ade3ed470e7b6669c05a.tar.gz
prosody-e21979a2ea063ee32e56ade3ed470e7b6669c05a.zip
mod_muc/muc.lib: Allow passing different <x> elements to be passed to :publicise_occupant_status()
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 0d6e4094..26d0b07d 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -191,7 +191,8 @@ end
-- Broadcasts an occupant's presence to the whole room
-- Takes the x element that goes into the stanzas
-function room_mt:publicise_occupant_status(occupant, base_x, nick, actor, reason)
+function room_mt:publicise_occupant_status(occupant, x, nick, actor, reason)
+ local base_x = x.base or x;
-- Build real jid and (optionally) occupant jid template presences
local base_presence do
-- Try to use main jid's presence
@@ -226,7 +227,7 @@ function room_mt:publicise_occupant_status(occupant, base_x, nick, actor, reason
local full_p, full_x;
local function get_full_p()
if full_p == nil then
- full_x = st.clone(base_x);
+ full_x = st.clone(x.full or base_x);
self:build_item_list(occupant, full_x, false, nick, actor_nick, actor, reason);
full_p = st.clone(base_presence):add_child(full_x);
end
@@ -236,7 +237,7 @@ function room_mt:publicise_occupant_status(occupant, base_x, nick, actor, reason
local anon_p, anon_x;
local function get_anon_p()
if anon_p == nil then
- anon_x = st.clone(base_x);
+ anon_x = st.clone(x.anon or base_x);
self:build_item_list(occupant, anon_x, true, nick, actor_nick, nil, reason);
anon_p = st.clone(base_presence):add_child(anon_x);
end
@@ -249,7 +250,7 @@ function room_mt:publicise_occupant_status(occupant, base_x, nick, actor, reason
else
-- Can always see your own full jids
-- But not allowed to see actor's
- self_x = st.clone(base_x);
+ self_x = st.clone(x.self or base_x);
self:build_item_list(occupant, self_x, false, nick, actor_nick, nil, reason);
self_p = st.clone(base_presence):add_child(self_x);
end