aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/s2smanager.lua5
-rw-r--r--core/sessionmanager.lua5
-rw-r--r--plugins/mod_component.lua2
3 files changed, 12 insertions, 0 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index f4f7ad36..4c758159 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -244,6 +244,11 @@ function streamopened(session, attr)
session.notopen = nil;
end
+function streamclosed(session)
+ session.send("</stream:stream>");
+ session.notopen = true;
+end
+
function initiate_dialback(session)
-- generate dialback key
session.dialback_key = generate_dialback(session.streamid, session.to_host, session.from_host);
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index b2b3c31b..1232922f 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -182,6 +182,11 @@ function streamopened(session, attr)
session.notopen = nil;
end
+function streamclosed(session)
+ session.send("</stream:stream>");
+ session.notopen = true;
+end
+
function send_to_available_resources(user, host, stanza)
local count = 0;
local to = stanza.attr.to;
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 5b59ca70..dbb52bf2 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -69,6 +69,8 @@ function stream_callbacks.streamopened(session, attr)
end
function stream_callbacks.streamclosed(session)
+ session.send("</stream:stream>");
+ session.notopen = true;
end
local core_process_stanza = core_process_stanza;