aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-23 01:05:28 +0100
committerKim Alvefur <zash@zash.se>2019-11-23 01:05:28 +0100
commit94f8d57fe4b3428973f0ba7b990915aa3abe3f7a (patch)
tree97bd8b669b1b8b44300440b766f0787ff47a9912 /plugins/muc
parentc62c176abe6ca5e33c25cdebcb7d1457486ce7ca (diff)
downloadprosody-94f8d57fe4b3428973f0ba7b990915aa3abe3f7a.tar.gz
prosody-94f8d57fe4b3428973f0ba7b990915aa3abe3f7a.zip
MUC: Keep role across nickname change (fixes #1466)
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index cf9b46f7..639ecc38 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -524,6 +524,9 @@ function room_mt:handle_normal_presence(origin, stanza)
log("debug", "no occupant found for %s; creating new occupant object for %s", dest_jid, real_jid);
is_first_dest_session = true;
dest_occupant = self:new_occupant(bare_jid, dest_jid);
+ if orig_occupant then
+ dest_occupant.role = orig_occupant.role;
+ end
else
is_first_dest_session = false;
end