Hi!

Slowly reviewing, some nits, questions, feedback:

On 2015-07-13 17:16, Tylor Reynolds wrote:
> mod_pubsub: fix registration of config-node and retrieve-default features
> diff --git a/plugins/mod_pubsub/mod_pubsub.lua 
> b/plugins/mod_pubsub/mod_pubsub.lua
> index 40c28d2..ba9df31 100644
> --- a/plugins/mod_pubsub/mod_pubsub.lua
> +++ b/plugins/mod_pubsub/mod_pubsub.lua
> @@ -68,11 +68,13 @@ local feature_map = {
>       get_items = { "retrieve-items" };
>       add_subscription = { "subscribe" };
>       get_subscriptions = { "retrieve-subscriptions" };
> -     set_configure = { "config-node" };
> -     get_default = { "retrieve-default" };
> +     set_node_config = { "config-node" };
>  };
>  
>  local function add_disco_features_from_service(service)
> +     -- not implemented by service, implemented by lib_pubsub
> +     module:add_feature(xmlns_pubsub.."#retrieve-default");
> +

Is there a reason for that instead of eg
`node_defaults = { "retrieve-default" };` ?

Switching to hardcoded values when the preset seems to be automagic
detection feels odd, but might be justifiable.

+       if not #actions then

This looks like a simple mistake in assuming that 0 in a boolean context
is false.

+       local action_names = {};
+       for _, action in ipairs(actions) do
+               table.insert(action_names, action.name)
+       end
+
+       local ns_ = namespace and namespace.."_" or "";
+       local compound_action = table.concat(action_names, "_");
+       local handler = handlers[stanza.attr.type.."_"..ns_..compound_action];
+
        if handler then
-               handler(origin, stanza, action, service);
+               if #actions <= 1 then actions = actions[1] end
+               handler(origin, stanza, actions, service);
                return true;
        end

Do we really need support for an arbitrary number of actions at the same
time?  Are there more than 2 anywhere?

-- 
Kim "Zash" Alvefur

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to