Mercurial > prosody-hg
diff util/adminstream.lua @ 10892:b9ff7178787c
util.adminstream: Fire event based on stanza name too for convenience
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 03 Jun 2020 22:26:48 +0100 |
| parents | c01c39a2c7a2 |
| children | 9e6d979dd603 |
line wrap: on
line diff
--- a/util/adminstream.lua Wed Jun 03 22:21:17 2020 +0100 +++ b/util/adminstream.lua Wed Jun 03 22:26:48 2020 +0100 @@ -271,7 +271,9 @@ client.thread = runner(function (stanza) if st.is_stanza(stanza) then - client.events.fire_event("received", stanza); + if not client.events.fire_event("received", stanza) and not stanza.attr.xmlns then + client.events.fire_event("received/"..stanza.name, stanza); + end elseif stanza.stream == "opened" then stream_callbacks._streamopened(client, stanza.attr); client.events.fire_event("connected");
