util.httpstream: A little cleanup of the HTTP path.
[prosody.git] / plugins / mod_pubsub.lua
index e0acfb65679d2d41e2b8cd075cfce7afdb6ff27f..841de14761b8108e070911b88096f74b8806a292 100644 (file)
@@ -193,7 +193,9 @@ local function add_disco_features_from_service(disco, service)
        for method, features in pairs(feature_map) do
                if service[method] then
                        for _, feature in ipairs(features) do
-                               disco:tag("feature", { var = xmlns_pubsub.."#"..feature }):up();
+                               if feature then
+                                       disco:tag("feature", { var = xmlns_pubsub.."#"..feature }):up();
+                               end
                        end
                end
        end
@@ -234,7 +236,8 @@ end);
 
 local admin_aff = module:get_option_string("default_admin_affiliation", "owner");
 local function get_affiliation(jid)
-       if jid == module.host or usermanager.is_admin(jid, module.host) then
+       local bare_jid = jid_bare(jid);
+       if bare_jid == module.host or usermanager.is_admin(bare_jid, module.host) then
                return admin_aff;
        end
 end