Software /
code /
prosody
Comparison
plugins/muc/muc.lib.lua @ 8174:260886554512
MUC: Include status code 110 on role change notifications (fixes #765))
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 06 Jul 2017 10:33:16 +0200 |
parent | 7997:aca13c433e45 |
child | 8175:b187da5b7e8f |
comparison
equal
deleted
inserted
replaced
8173:3ff99d49082f | 8174:260886554512 |
---|---|
1081 end | 1081 end |
1082 x:tag("status", {code = "307"}):up(); | 1082 x:tag("status", {code = "307"}):up(); |
1083 else | 1083 else |
1084 occupant.role = role; | 1084 occupant.role = role; |
1085 end | 1085 end |
1086 local self_x = st.clone(x); | |
1087 self_x:tag("status", {code = "110"}):up(); | |
1086 local bp; | 1088 local bp; |
1087 for jid,pres in pairs(occupant.sessions) do -- send to all sessions of the nick | 1089 for jid,pres in pairs(occupant.sessions) do -- send to all sessions of the nick |
1088 local p = st.clone(pres); | 1090 local p = st.clone(pres); |
1089 p.attr.from = occupant_jid; | 1091 p.attr.from = occupant_jid; |
1090 p.attr.type = presence_type; | 1092 p.attr.type = presence_type; |
1091 p.attr.to = jid; | 1093 p.attr.to = jid; |
1092 p:add_child(x); | 1094 if occupant.jid == jid then |
1095 bp = st.clone(p); | |
1096 bp:add_child(x); | |
1097 end | |
1098 p:add_child(self_x); | |
1093 self:_route_stanza(p); | 1099 self:_route_stanza(p); |
1094 if occupant.jid == jid then | |
1095 bp = p; | |
1096 end | |
1097 end | 1100 end |
1098 if callback then callback(); end | 1101 if callback then callback(); end |
1099 if bp then | 1102 if bp then |
1100 self:broadcast_except_nick(bp, occupant_jid); | 1103 self:broadcast_except_nick(bp, occupant_jid); |
1101 end | 1104 end |