aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commit56c159d7c947f3bb71b33a4ff3e4f1fba8ebd30a (patch)
tree998c811673d5f23a172fe27d8c6a7b57139d3a2d /util
parentbaf9f5aeefeb2900af1d3026799ec382f4f69d5b (diff)
downloadprosody-56c159d7c947f3bb71b33a4ff3e4f1fba8ebd30a.tar.gz
prosody-56c159d7c947f3bb71b33a4ff3e4f1fba8ebd30a.zip
util.adminstream: Fire event based on stanza name too for convenience
Diffstat (limited to 'util')
-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");