Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 8795:aaff40ec7001
MUC: Restore status codes on presence sent to occupant when their affiliation changes (thanks jonasw)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 16 May 2018 23:57:30 +0100 |
| parents | 05a3275b6873 |
| children | 51375b007239 a7221ada9368 |
comparison
equal
deleted
inserted
replaced
| 8793:05a3275b6873 | 8795:aaff40ec7001 |
|---|---|
| 1134 self_x:tag("status", {code="110"}); | 1134 self_x:tag("status", {code="110"}); |
| 1135 local presence_type = nil; | 1135 local presence_type = nil; |
| 1136 if not role then -- getting kicked | 1136 if not role then -- getting kicked |
| 1137 presence_type = "unavailable"; | 1137 presence_type = "unavailable"; |
| 1138 if affiliation == "outcast" then | 1138 if affiliation == "outcast" then |
| 1139 x:tag("status", {code="301"}):up(); -- banned | 1139 -- banned |
| 1140 x:tag("status", {code="301"}):up(); | |
| 1141 self_x:tag("status", {code="301"}):up(); | |
| 1140 else | 1142 else |
| 1141 x:tag("status", {code="321"}):up(); -- affiliation change | 1143 -- affiliation change |
| 1144 x:tag("status", {code="321"}):up(); | |
| 1145 self_x:tag("status", {code="321"}):up(); | |
| 1142 end | 1146 end |
| 1143 end | 1147 end |
| 1144 for nick, occupant in pairs(self._occupants) do | 1148 for nick, occupant in pairs(self._occupants) do |
| 1145 if jid_bare(occupant.jid) == jid then | 1149 if jid_bare(occupant.jid) == jid then |
| 1146 if not role then -- getting kicked | 1150 if not role then -- getting kicked |
