# HG changeset patch # User Matthew Wild # Date 1256599815 0 # Node ID 77244fd4ca99d663f6857d168c696eb20abdc3b4 # Parent ee2929e620bb5ba11c2f89191de8718c88209b3f# Parent c781a949661d0cda3fc0864870ec8e695e3a7b9d Merge with trunk diff -r ee2929e620bb -r 77244fd4ca99 net/xmppserver_listener.lua --- a/net/xmppserver_listener.lua Mon Oct 26 23:29:04 2009 +0000 +++ b/net/xmppserver_listener.lua Mon Oct 26 23:30:15 2009 +0000 @@ -61,8 +61,8 @@ function session.data(conn, data) local ok, err = parser:parse(data); if ok then return; end - (log or session.log)("warn", "Received invalid XML: %s", data); - (log or session.log)("warn", "Problem was: %s", err); + (session.log or log)("warn", "Received invalid XML: %s", data); + (session.log or log)("warn", "Problem was: %s", err); session:close("xml-not-well-formed"); end diff -r ee2929e620bb -r 77244fd4ca99 plugins/mod_console.lua --- a/plugins/mod_console.lua Mon Oct 26 23:29:04 2009 +0000 +++ b/plugins/mod_console.lua Mon Oct 26 23:30:15 2009 +0000 @@ -127,7 +127,11 @@ end function console_listener.disconnect(conn, err) - + local session = sessions[conn]; + if session then + session.disconnect(); + sessions[conn] = nil; + end end connlisteners_register('console', console_listener); diff -r ee2929e620bb -r 77244fd4ca99 plugins/mod_welcome.lua --- a/plugins/mod_welcome.lua Mon Oct 26 23:29:04 2009 +0000 +++ b/plugins/mod_welcome.lua Mon Oct 26 23:30:15 2009 +0000 @@ -7,7 +7,7 @@ -- local host = module:get_host(); -local welcome_text = module:get_option("welcome_message") or "Hello $user, welcome to the $host IM server!"; +local welcome_text = module:get_option("welcome_message") or "Hello $username, welcome to the $host IM server!"; local st = require "util.stanza"; diff -r ee2929e620bb -r 77244fd4ca99 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Mon Oct 26 23:29:04 2009 +0000 +++ b/plugins/muc/muc.lib.lua Mon Oct 26 23:30:15 2009 +0000 @@ -115,7 +115,7 @@ stanza = get_filtered_presence(stanza); local occupant = self._occupants[stanza.attr.from]; stanza:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=occupant.affiliation, role=occupant.role, nick=nick}):up(); + :tag("item", {affiliation=occupant.affiliation or "none", role=occupant.role or "none", nick=nick}):up(); if code then stanza:tag("status", {code=code}):up(); end @@ -162,7 +162,7 @@ local pres = get_filtered_presence(o_data.sessions[o_data.jid]); pres.attr.to, pres.attr.from = to, occupant; pres:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=o_data.affiliation, role=o_data.role}):up(); + :tag("item", {affiliation=o_data.affiliation or "none", role=o_data.role or "none"}):up(); self:route_stanza(pres); end end @@ -232,13 +232,14 @@ occupant.sessions[from] = nil; pr.attr.to = from; pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=occupant.affiliation, role='none'}):up() + :tag("item", {affiliation=occupant.affiliation or "none", role='none'}):up() :tag("status", {code='110'}); self:route_stanza(pr); if jid ~= new_jid then pr = st.clone(occupant.sessions[new_jid]) :tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=occupant.affiliation, role=occupant.role}); + :tag("item", {affiliation=occupant.affiliation or "none", role=occupant.role or "none"}); + pr.attr.from = current_nick; self:broadcast_except_nick(pr, current_nick); end else @@ -322,7 +323,7 @@ else pr.attr.to = from; self:route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=affiliation, role=role}):up() + :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() :tag("status", {code='110'})); end self:send_history(from); diff -r ee2929e620bb -r 77244fd4ca99 prosody --- a/prosody Mon Oct 26 23:29:04 2009 +0000 +++ b/prosody Mon Oct 26 23:30:15 2009 +0000 @@ -282,7 +282,7 @@ function loop() -- Error handler for errors that make it this far local function catch_uncaught_error(err) - if err:match("%d*: interrupted!$") then + if type(err) == "string" and err:match("%d*: interrupted!$") then return "quitting"; end