]> granicus.if.org Git - ejabberd/commitdiff
ignore unknown configuration fields (EJAB-762); fix node authorization bug (EJAB...
authorChristophe Romain <christophe.romain@process-one.net>
Mon, 8 Dec 2008 19:38:59 +0000 (19:38 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Mon, 8 Dec 2008 19:38:59 +0000 (19:38 +0000)
SVN Revision: 1713

ChangeLog
src/mod_pubsub/mod_pubsub.erl
src/mod_pubsub/pubsub.hrl

index 9c3a07b88c6a972cd93580b13cd32de65896763e..76e7a24ba551feda24a9202850a95930790f4c47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@
        * src/mod_pubsub/mod_pubsub.erl: Likewise
        * src/mod_caps.erl: Likewise
 
+       * src/mod_pubsub.erl: ignore unknown configuration fields (EJAB-762);
+       fix node authorization bug (EJAB-798)
+
+       * src/pubsub.hrl: remove unused pubsub_presence record
+
 2008-12-08  Mickael Remond  <mremond@process-one.net>
 
        * src/ejabberd_c2s.erl: Enforce client stanza from attribute
index c527030753833a4b64dda7b08d06b884db10eb2d..81ed6f64e50e023a7f87322b4c03b206249638dd 100644 (file)
@@ -1049,7 +1049,7 @@ find_authorization_response(Packet) ->
        [] -> none;
        [XFields] when is_list(XFields) ->
            case lists:keysearch("FORM_TYPE", 1, XFields) of
-               {value, {_, ?NS_PUBSUB_SUB_AUTH}} ->
+               {value, {_, [?NS_PUBSUB_SUB_AUTH]}} ->
                    XFields;
                _ ->
                    invalid
@@ -1060,8 +1060,8 @@ handle_authorization_response(Host, From, To, Packet, XFields) ->
     case {lists:keysearch("pubsub#node", 1, XFields),
          lists:keysearch("pubsub#subscriber_jid", 1, XFields),
          lists:keysearch("pubsub#allow", 1, XFields)} of
-       {{value, {_, SNode}}, {value, {_, SSubscriber}},
-        {value, {_, SAllow}}} ->
+       {{value, {_, [SNode]}}, {value, {_, [SSubscriber]}},
+        {value, {_, [SAllow]}}} ->
            Node = case Host of
                       {_, _, _} -> [SNode];
                       _ -> string:tokens(SNode, "/")
@@ -1076,7 +1076,7 @@ handle_authorization_response(Host, From, To, Packet, XFields) ->
                                      %%options = Options,
                                      owners = Owners}) ->
                             IsApprover = lists:member(jlib:jid_tolower(jlib:jid_remove_resource(From)), Owners),
-                            Subscription = node_call(Type, get_subscription, [Host, Node, Subscriber]),
+                            {result, Subscription} = node_call(Type, get_subscription, [Host, Node, Subscriber]),
                             if
                                 not IsApprover ->
                                     {error, ?ERR_FORBIDDEN};
@@ -2637,8 +2637,9 @@ set_xoption([{"pubsub#type", Value} | Opts], NewOpts) ->
     ?SET_STRING_XOPT(type, Value);
 set_xoption([{"pubsub#body_xslt", Value} | Opts], NewOpts) ->
     ?SET_STRING_XOPT(body_xslt, Value);
-set_xoption([_ | _Opts], _NewOpts) ->
-    {error, ?ERR_NOT_ACCEPTABLE}.
+set_xoption([_ | Opts], NewOpts) ->
+    % skip unknown field
+    set_xoption(Opts, NewOpts).
 
 %%%% plugin handling
 
index 3b3d4cce106d88b91d2192f9d10809fd4831dce0..959124e4c3de83d556b2cf06b71fb3804658da53 100644 (file)
                      payload = []
                     }).
 
-
-%% @type pubsubPresence() = #pubsub_presence{
-%%     key = {Host::host(), User::string(), Server::string()},
-%%     presence = list().
-%%% <p>This is the format of the <tt>published presence</tt> table. The type of the
-%%% table is: <tt>set</tt>,<tt>ram</tt>.</p>
--record(pubsub_presence, {key,
-                         resource
-                        }).
-