Mercurial > prosody-hg
comparison plugins/mod_presence.lua @ 1044:41a0c76127f4
mod_presence: Fix for local presence subscriptions and probes
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 23 Apr 2009 02:48:22 +0500 |
| parents | c0a3ef0a1f34 |
| children | 2677f5a4e66b |
comparison
equal
deleted
inserted
replaced
| 1043:ad87f555b484 | 1044:41a0c76127f4 |
|---|---|
| 22 local hosts = hosts; | 22 local hosts = hosts; |
| 23 | 23 |
| 24 local rostermanager = require "core.rostermanager"; | 24 local rostermanager = require "core.rostermanager"; |
| 25 local sessionmanager = require "core.sessionmanager"; | 25 local sessionmanager = require "core.sessionmanager"; |
| 26 local offlinemanager = require "core.offlinemanager"; | 26 local offlinemanager = require "core.offlinemanager"; |
| 27 | |
| 28 local _core_route_stanza = core_route_stanza; | |
| 29 local core_route_stanza; | |
| 30 function core_route_stanza(origin, stanza) | |
| 31 if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then | |
| 32 local node, host = jid_split(stanza.attr.to); | |
| 33 host = hosts[host]; | |
| 34 if host and host.type == "local" then | |
| 35 handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to), core_route_stanza); | |
| 36 return; | |
| 37 end | |
| 38 end | |
| 39 _core_route_stanza(origin, stanza); | |
| 40 end | |
| 27 | 41 |
| 28 function handle_presence(origin, stanza, from_bare, to_bare, core_route_stanza, inbound) | 42 function handle_presence(origin, stanza, from_bare, to_bare, core_route_stanza, inbound) |
| 29 local type = stanza.attr.type; | 43 local type = stanza.attr.type; |
| 30 if type and type ~= "unavailable" and type ~= "error" then | 44 if type and type ~= "unavailable" and type ~= "error" then |
| 31 if inbound then | 45 if inbound then |
