Some bugs fixed

This commit is contained in:
Waqas Hussain 2008-11-15 05:33:14 +05:00
parent 22df06d27d
commit fc57c3a09a
4 changed files with 4 additions and 4 deletions

View file

@ -16,7 +16,7 @@ function load(node, host)
local data = datamanager.list_load(node, host, "offline");
if not data then return; end
for k, v in ipairs(data) do
stanza = st.deserialize(v);
local stanza = st.deserialize(v);
stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = host, stamp = stanza.attr.stamp}):up(); -- XEP-0203
stanza:tag("x", {xmlns = "jabber:x:delay", from = host, stamp = stanza.attr.stamp_legacy}):up(); -- XEP-0091 (deprecated)
stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil;

View file

@ -234,7 +234,7 @@ function unsubscribed(username, host, jid)
if item.subscription == "from" then
item.subscription = "none";
changed = true;
elseif item.subscription == both then
elseif item.subscription == "both" then
item.subscription = "to";
changed = true;
end

View file

@ -78,7 +78,7 @@ function xmppclient.disconnect(conn)
if session then
if session.last_presence and session.last_presence.attr.type ~= "unavailable" then
local pres = st.presence{ type = "unavailable" };
if err == "closed" then err = "connection closed"; end
if err == "closed" then err = "connection closed"; end --FIXME where did err come from?
pres:tag("status"):text("Disconnected: "..err);
session.stanza_dispatch(pres);
end

View file

@ -6,7 +6,7 @@ local loadfile, setfenv, pcall = loadfile, setfenv, pcall;
local log = log;
local io_open = io.open;
local os_remove = os.remove;
local tostring = tostring;
local tostring, tonumber = tostring, tonumber;
local error = error;
local next = next;
local t_insert = table.insert;