diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-11 22:22:24 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-11 22:22:24 +0100 |
commit | 0ddf0a3232f175e8d160b54549bb4a1ff1afe63d (patch) | |
tree | 03670ad63eb6d9bf9126b8feed4d1dbca9052a00 /plugins/mod_component.lua | |
parent | e7cd3523a4ad79e14897a12b65a192ebcb8e1581 (diff) | |
download | prosody-0ddf0a3232f175e8d160b54549bb4a1ff1afe63d.tar.gz prosody-0ddf0a3232f175e8d160b54549bb4a1ff1afe63d.zip |
mod_component: Deregister component on disconnect
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r-- | plugins/mod_component.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index f06264c3..bbd49c5e 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -14,6 +14,7 @@ local t_concat = table.concat; local connlisteners = require "net.connlisteners"; local cm_register_component = require "core.componentmanager".register_component; +local cm_deregister_component = require "core.componentmanager".deregister_component; local uuid_gen = require "util.uuid".generate; local sha1 = require "util.hashes".sha1; local st = stanza; @@ -196,9 +197,9 @@ function component_listener.disconnect(conn, err) if session then (session.log or log)("info", "component disconnected: %s (%s)", tostring(session.host), tostring(err)); if session.host then - if session.component then - deregister_component(session.host); - end + log("debug", "deregistering component"); + cm_deregister_component(session.host); + hosts[session.host].connected = nil; end sessions[conn] = nil; session = nil; |