diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-04-29 00:36:04 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-04-29 00:36:04 +0100 |
commit | fd324936d0c7a45c9e2b54a3eb4690bf5f46b020 (patch) | |
tree | b64e7d91badb210f2c1e3a857ddf921b164fb8aa /plugins/mod_s2s/mod_s2s.lua | |
parent | c5f20ce901c0c929c4ff5378269288e30c6977b4 (diff) | |
parent | f704c2bc9045e92272fdd687c887771754b55007 (diff) | |
download | prosody-fd324936d0c7a45c9e2b54a3eb4690bf5f46b020.tar.gz prosody-fd324936d0c7a45c9e2b54a3eb4690bf5f46b020.zip |
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index a935239e..30ebb706 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -348,7 +348,7 @@ function stream_callbacks.streamopened(session, attr) end end - session:open_stream() + session:open_stream(session.to_host, session.from_host) if session.version >= 1.0 then local features = st.stanza("stream:features"); @@ -448,7 +448,11 @@ local function session_close(session, reason, remote_reason) local log = session.log or log; if session.conn then if session.notopen then - session:open_stream() + if session.direction == "incoming" then + session:open_stream(session.to_host, session.from_host); + else + session:open_stream(session.from_host, session.to_host); + end end if reason then -- nil == no err, initiated by us, false == initiated by remote if type(reason) == "string" then -- assume stream error @@ -496,8 +500,6 @@ local function session_close(session, reason, remote_reason) end function session_open_stream(session, from, to) - local from = from or session.from_host; - local to = to or session.to_host; local attr = { ["xmlns:stream"] = 'http://etherx.jabber.org/streams', xmlns = 'jabber:server', @@ -506,8 +508,7 @@ function session_open_stream(session, from, to) id = session.streamid, from = from, to = to, } - local local_host = session.direction == "outgoing" and from or to; - if not local_host or (hosts[local_host] and hosts[local_host].modules.dialback) then + if not from or (hosts[from] and hosts[from].modules.dialback) then attr["xmlns:db"] = 'jabber:server:dialback'; end |