Software /
code /
prosody-modules
Comparison
mod_muc_occupant_id/mod_muc_occupant_id.lua @ 3630:c05e157d987c
mod_muc_occupant_id: Remove unnecessary check on occupant
author | Maxime “pep” Buquet <pep@bouah.net> |
---|---|
date | Sun, 14 Jul 2019 19:04:16 +0200 |
parent | 3629:cfe0907808e1 |
child | 3631:d6164ae6179c |
comparison
equal
deleted
inserted
replaced
3629:cfe0907808e1 | 3630:c05e157d987c |
---|---|
38 end | 38 end |
39 | 39 |
40 -- strip any existing <occupant-id/> tags to avoid forgery | 40 -- strip any existing <occupant-id/> tags to avoid forgery |
41 stanza:remove_children("occupant-id", xmlns_occupant_id); | 41 stanza:remove_children("occupant-id", xmlns_occupant_id); |
42 | 42 |
43 if not occupant then return; end | |
44 | |
45 local unique_id = occupant.sessions[stanza.attr.from] | 43 local unique_id = occupant.sessions[stanza.attr.from] |
46 :get_child("occupant-id", xmlns_occupant_id) | 44 :get_child("occupant-id", xmlns_occupant_id) |
47 :get_text(); | 45 :get_text(); |
48 stanza:tag("occupant-id", { xmlns = xmlns_occupant_id }) | 46 stanza:tag("occupant-id", { xmlns = xmlns_occupant_id }) |
49 :text(unique_id) | 47 :text(unique_id) |