Apply IDNA to ASCII on hostnames.
[prosody.git] / core / rostermanager.lua
index 757c9a6cddd0d6f6cb42d2fbbdb8e2e09380a9ca..a08f989dbd81633c7a25ef04499f94b2ba3c8ca7 100644 (file)
@@ -1,8 +1,6 @@
 
-local mainlog = log;
-local function log(type, message)
-       mainlog(type, "rostermanager", message);
-end
+
+local log = require "util.logger".init("rostermanager");
 
 local setmetatable = setmetatable;
 local format = string.format;
@@ -59,8 +57,8 @@ function roster_push(username, host, jid)
                else
                        stanza:tag("item", {jid = jid, subscription = "remove"});
                end
-               stanza:up();
-               stanza:up();
+               stanza:up(); -- move out from item
+               stanza:up(); -- move out from stanza
                -- stanza ready
                for _, session in pairs(hosts[host].sessions[username].sessions) do
                        if session.interested then
@@ -234,7 +232,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