Software /
code /
prosody
Comparison
core/stanza_router.lua @ 8347:c72db8047440
core.stanza_router: Verify that xmlns exists for firing stanza/iq/xmlns/name events (fixes #1022) (thanks SamWhited)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 17 Oct 2017 07:09:00 +0200 |
parent | 7947:24170d74b00b |
child | 8676:39ab6a296419 |
child | 9067:89e1bf37ff64 |
comparison
equal
deleted
inserted
replaced
8293:34814a908557 | 8347:c72db8047440 |
---|---|
138 else | 138 else |
139 local h = hosts[stanza.attr.to or origin.host or origin.to_host]; | 139 local h = hosts[stanza.attr.to or origin.host or origin.to_host]; |
140 if h then | 140 if h then |
141 local event; | 141 local event; |
142 if xmlns == nil then | 142 if xmlns == nil then |
143 if stanza.name == "iq" and (stanza.attr.type == "set" or stanza.attr.type == "get") then | 143 if stanza.name == "iq" and (stanza.attr.type == "set" or stanza.attr.type == "get") |
144 and stanza.tags[1] and stanza.tags[1].attr.xmlns then | |
144 event = "stanza/iq/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name; | 145 event = "stanza/iq/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name; |
145 else | 146 else |
146 event = "stanza/"..stanza.name; | 147 event = "stanza/"..stanza.name; |
147 end | 148 end |
148 else | 149 else |