Software /
code /
prosody
Changeset
6008:e6f735c62c5d
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 03 Feb 2014 07:25:05 +0100 |
parents | 6001:34f43c8167e5 (current diff) 6007:ff24bc2d41a6 (diff) |
children | 6011:a35c9e52b02e |
files | |
diffstat | 7 files changed, 28 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/core/modulemanager.lua Tue Jan 21 03:26:04 2014 +0000 +++ b/core/modulemanager.lua Mon Feb 03 07:25:05 2014 +0100 @@ -29,7 +29,7 @@ return xpcall(function() return f(unpack(params, 1, n)) end, function(e) return tostring(e).."\n"..debug_traceback(); end); end -local autoload_modules = {"presence", "message", "iq", "offline", "c2s", "s2s"}; +local autoload_modules = {prosody.platform, "presence", "message", "iq", "offline", "c2s", "s2s"}; local component_inheritable_modules = {"tls", "dialback", "iq", "s2s"}; -- We need this to let modules access the real global namespace
--- a/plugins/mod_c2s.lua Tue Jan 21 03:26:04 2014 +0000 +++ b/plugins/mod_c2s.lua Mon Feb 03 07:25:05 2014 +0100 @@ -38,7 +38,6 @@ --- Stream events handlers local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'}; -local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/streams", xmlns = stream_callbacks.default_ns, version = "1.0", id = "" }; function stream_callbacks.streamopened(session, attr) local send = session.send; @@ -58,9 +57,7 @@ return; end - send("<?xml version='1.0'?>"..st.stanza("stream:stream", { - xmlns = 'jabber:client', ["xmlns:stream"] = 'http://etherx.jabber.org/streams'; - id = session.streamid, from = session.host, version = '1.0', ["xml:lang"] = 'en' }):top_tag()); + session:open_stream(); (session.log or log)("debug", "Sent reply <stream:stream> to client"); session.notopen = nil; @@ -129,8 +126,7 @@ local log = session.log or log; if session.conn then if session.notopen then - session.send("<?xml version='1.0'?>"); - session.send(st.stanza("stream:stream", default_stream_attr):top_tag()); + session:open_stream(); end if reason then -- nil == no err, initiated by us, false == initiated by client local stream_error = st.stanza("stream:error"); @@ -178,6 +174,19 @@ end end +local function session_open_stream(session) + local attr = { + ["xmlns:stream"] = 'http://etherx.jabber.org/streams', + xmlns = stream_callbacks.default_ns, + version = "1.0", + ["xml:lang"] = 'en', + id = session.streamid or "", + from = session.host + }; + session.send("<?xml version='1.0'?>"); + session.send(st.stanza("stream:stream", attr):top_tag()); +end + module:hook_global("user-deleted", function(event) local username, host = event.username, event.host; local user = hosts[host].sessions[username]; @@ -225,6 +234,7 @@ conn:setoption("keepalive", opt_keepalives); end + session.open_stream = session_open_stream; session.close = session_close; local stream = new_xmpp_stream(session, stream_callbacks);
--- a/plugins/mod_posix.lua Tue Jan 21 03:26:04 2014 +0000 +++ b/plugins/mod_posix.lua Mon Feb 03 07:25:05 2014 +0100 @@ -128,7 +128,7 @@ end require "core.loggingmanager".register_sink_type("syslog", syslog_sink_maker); -local daemonize = module:get_option("daemonize"); +local daemonize = module:get_option("daemonize", prosody.installed); if daemonize == nil then local no_daemonize = module:get_option("no_daemonize"); --COMPAT w/ 0.5 daemonize = not no_daemonize;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/mod_unknown.lua Mon Feb 03 07:25:05 2014 +0100 @@ -0,0 +1,4 @@ +-- Unknown platform stub +module:set_global(); + +-- TODO Do things that make sense if we don't know about the platform
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/mod_windows.lua Mon Feb 03 07:25:05 2014 +0100 @@ -0,0 +1,4 @@ +-- Windows platform stub +module:set_global(); + +-- TODO Add Windows-specific things here
--- a/plugins/muc/muc.lib.lua Tue Jan 21 03:26:04 2014 +0000 +++ b/plugins/muc/muc.lib.lua Mon Feb 03 07:25:05 2014 +0100 @@ -570,6 +570,7 @@ end stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id; else -- message + stanza:tag("x", { xmlns = "http://jabber.org/protocol/muc#user" }):up(); stanza.attr.from = current_nick; for jid in pairs(o_data.sessions) do stanza.attr.to = jid;
--- a/tools/ejabberd2prosody.lua Tue Jan 21 03:26:04 2014 +0000 +++ b/tools/ejabberd2prosody.lua Mon Feb 03 07:25:05 2014 +0100 @@ -163,7 +163,7 @@ function muc_room(node, host, properties) local store = { jid = node.."@"..host, _data = {}, _affiliations = {} }; for _,aff in ipairs(properties.affiliations) do - store._affiliations[_table_to_jid(aff[1])] = aff[2]; + store._affiliations[_table_to_jid(aff[1])] = aff[2][1] or aff[2]; end store._data.subject = properties.subject; if properties.subject_author then