aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-03 22:26:48 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-03 22:26:48 +0100
commit43c83b93420116f1ed88981268bbe8e7919dd27e (patch)
tree998c811673d5f23a172fe27d8c6a7b57139d3a2d
parent59b96c51b0037eeaf02da285cb66b6910e5efe49 (diff)
downloadprosody-43c83b93420116f1ed88981268bbe8e7919dd27e.tar.gz
prosody-43c83b93420116f1ed88981268bbe8e7919dd27e.zip
util.adminstream: Fire event based on stanza name too for convenience
-rw-r--r--util/adminstream.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/adminstream.lua b/util/adminstream.lua
index 4583b322..70fa2b19 100644
--- a/util/adminstream.lua
+++ b/util/adminstream.lua
@@ -271,7 +271,9 @@ local function new_client()
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");