Mercurial > prosody-modules
changeset 6311:2525f247084c
mod_drop_chatstates: Fix bug using stanza before its defined
| author | Chaz Kettleson <chaz@pyr3x.com> |
|---|---|
| date | Sat, 02 Aug 2025 11:06:31 -0400 |
| parents | 92e2dcf039d9 |
| children | ef969153ef65 |
| files | mod_drop_chatstates/mod_drop_chatstates.lua |
| diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_drop_chatstates/mod_drop_chatstates.lua Sat Aug 02 10:51:20 2025 -0400 +++ b/mod_drop_chatstates/mod_drop_chatstates.lua Sat Aug 02 11:06:31 2025 -0400 @@ -5,9 +5,10 @@ local domains = module:get_option_set("drop_chatstates_domains", {}) local function handle_pre_message(event) + local stanza = event.stanza local to_host = jid.host(stanza.attr.to) if not to_host or not domains:contains(to_host) then return end - if event.stanza:get_child(nil, CHATSTATES_NS) then return true end + if stanza:get_child(nil, CHATSTATES_NS) then return true end end module:hook("pre-message/bare", handle_pre_message)
