diff options
-rw-r--r-- | core/moduleapi.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index 59417027..a38a6076 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -439,7 +439,10 @@ function api:send_iq(stanza, origin, timeout) local wrapped_origin = setmetatable({ -- XXX Needed in some cases for replies to work correctly when sending queries internally. send = function (reply) - resolve({ stanza = reply }); + if reply.name == stanza.name and reply.attr.id == stanza.attr.id then + resolve({ stanza = reply }); + end + return (origin or hosts[self.host]).send(reply) end; }, { __index = origin or hosts[self.host]; |