Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 9145:51c5dd7a8ab9
MUC: Suppress error text when participants are kicked due to error in semi-anon rooms (fixes #563)
This prevents information leaks (such as the occupant's server domain) which may
be included in error messages.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 07 Aug 2018 13:32:11 +0100 |
| parents | ce57c69a20e2 |
| children | e2bf4cd6d7a3 |
comparison
equal
deleted
inserted
replaced
| 9144:b40efef8ec99 | 9145:51c5dd7a8ab9 |
|---|---|
| 360 local real_jid = stanza.attr.from; | 360 local real_jid = stanza.attr.from; |
| 361 local occupant = self:get_occupant_by_real_jid(real_jid); | 361 local occupant = self:get_occupant_by_real_jid(real_jid); |
| 362 if occupant == nil then return nil; end | 362 if occupant == nil then return nil; end |
| 363 local type, condition, text = stanza:get_error(); | 363 local type, condition, text = stanza:get_error(); |
| 364 local error_message = "Kicked: "..(condition and condition:gsub("%-", " ") or "presence error"); | 364 local error_message = "Kicked: "..(condition and condition:gsub("%-", " ") or "presence error"); |
| 365 if text then | 365 if text and room:get_whois() == "anyone" then |
| 366 error_message = error_message..": "..text; | 366 error_message = error_message..": "..text; |
| 367 end | 367 end |
| 368 occupant:set_session(real_jid, st.presence({type="unavailable"}) | 368 occupant:set_session(real_jid, st.presence({type="unavailable"}) |
| 369 :tag('status'):text(error_message)); | 369 :tag('status'):text(error_message)); |
| 370 local is_last_session = occupant.jid == real_jid; | 370 local is_last_session = occupant.jid == real_jid; |
