aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-26 23:30:15 +0000
committerMatthew Wild <mwild1@gmail.com>2009-10-26 23:30:15 +0000
commitf0b9e5befac2aef2c57d68d1441faed693bacea6 (patch)
tree6b0f9746afaa3356db58aa3a7ef0cc533bd87d04 /plugins
parent493cfc98173579fe924d06b353cf5416471dec1c (diff)
parentc73ece03d8efcc4b46712ff32b7da610cb21dc4f (diff)
downloadprosody-f0b9e5befac2aef2c57d68d1441faed693bacea6.tar.gz
prosody-f0b9e5befac2aef2c57d68d1441faed693bacea6.zip
Merge with trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_console.lua6
-rw-r--r--plugins/mod_welcome.lua2
-rw-r--r--plugins/muc/muc.lib.lua11
3 files changed, 12 insertions, 7 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index a46eec12..5a092298 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -127,7 +127,11 @@ function console_listener.listener(conn, data)
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 --git a/plugins/mod_welcome.lua b/plugins/mod_welcome.lua
index cc50cba3..edcfbd8c 100644
--- a/plugins/mod_welcome.lua
+++ b/plugins/mod_welcome.lua
@@ -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 --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 7a635e8e..312dcc37 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -115,7 +115,7 @@ function room_mt:broadcast_presence(stanza, sid, code, nick)
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 @@ function room_mt:send_occupant_list(to)
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 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
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 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
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);