Mercurial > prosody-modules
comparison mod_delegation/mod_delegation.lua @ 1777:c353acd1d366
Merge with Goffi
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 10 Aug 2015 21:13:31 +0200 |
| parents | e7b5ab44339c |
| children | d7c1daaf2dea |
comparison
equal
deleted
inserted
replaced
| 1773:fb2b9a2e2316 | 1777:c353acd1d366 |
|---|---|
| 141 for callback in connected_cb:items() do | 141 for callback in connected_cb:items() do |
| 142 callback(event) | 142 callback(event) |
| 143 end | 143 end |
| 144 end | 144 end |
| 145 | 145 |
| 146 connected_cb:add(on_component_connected) | 146 if module:get_host_type() ~= "component" then |
| 147 connected_cb:add(on_component_connected) | |
| 148 end | |
| 147 module:hook('component-authenticated', on_component_auth) | 149 module:hook('component-authenticated', on_component_auth) |
| 148 module:hook('presence/initial', on_presence) | 150 module:hook('presence/initial', on_presence) |
| 149 | 151 |
| 150 | 152 |
| 151 --> delegated namespaces hook <-- | 153 --> delegated namespaces hook <-- |
| 183 end | 185 end |
| 184 | 186 |
| 185 local iq = forwarded.tags[1] | 187 local iq = forwarded.tags[1] |
| 186 if #forwarded ~= 1 or iq.name ~= "iq" or | 188 if #forwarded ~= 1 or iq.name ~= "iq" or |
| 187 iq.attr.xmlns ~= 'jabber:client' or | 189 iq.attr.xmlns ~= 'jabber:client' or |
| 188 (iq.attr.type =='result' and #iq ~= 1) or | 190 (iq.attr.type =='result' and #iq > 1) or |
| 189 (iq.attr.type == 'error' and #iq > 2) then | 191 (iq.attr.type == 'error' and #iq > 2) then |
| 190 module:log("warn", "ignoring invalid iq result from managing entity %s", stanza.attr.from) | 192 module:log("warn", "ignoring invalid iq result from managing entity %s", stanza.attr.from) |
| 191 stanza_cache[stanza.attr.from][stanza.attr.id] = nil | 193 stanza_cache[stanza.attr.from][stanza.attr.id] = nil |
| 192 return true | 194 return true |
| 193 end | 195 end |
