25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

fix nodetree plugin resolver, and backport last changes from trunk

SVN Revision: 1890
This commit is contained in:
Christophe Romain 2009-02-19 11:29:01 +00:00
parent 5334a2d965
commit edc0a9ac87
9 changed files with 33 additions and 19 deletions

View File

@ -1,3 +1,16 @@
2009-02-19 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: fix nodetree plugin resolver
* src/mod_pubsub/mod_pubsub.erl: backport last changes from trunk
* src/mod_pubsub/node_mb.erl: Likewise
* src/mod_pubsub/node_buddy.erl: Likewise
* src/mod_pubsub/node_private.erl: Likewise
* src/mod_pubsub/node_public.erl: Likewise
* src/mod_pubsub/node_default.erl: Likewise
* src/mod_pubsub/node_pep.erl: Likewise
* src/mod_pubsub/node_club.erl: Likewise
2009-02-18 Pablo Polvorin <pablo.polvorin@process-one.net>
* src/ejabberd_auth.erl: Fix: for legacy authentication, the Digest

View File

@ -33,14 +33,13 @@
%%% This module uses version 1.12 of the specification as a base.
%%% Most of the specification is implemented.
%%% Functions concerning configuration should be rewritten.
%%% Code is derivated from the original pubsub v1.7, by Alexey Shchepin
%%% TODO
%%% plugin: generate Reply (do not use broadcast atom anymore)
-module(mod_pubsub).
-author('christophe.romain@process-one.net').
-version('1.12-01').
-version('1.12-02').
-behaviour(gen_server).
-behaviour(gen_mod).
@ -237,6 +236,8 @@ init_nodes(Host, ServerHost) ->
ok.
update_database(Host) ->
mnesia:del_table_index(pubsub_node, type),
mnesia:del_table_index(pubsub_node, parentid),
case catch mnesia:table_info(pubsub_node, attributes) of
[host_node, host_parent, info] ->
?INFO_MSG("upgrade pubsub tables",[]),
@ -1581,7 +1582,7 @@ delete_item(Host, Node, Publisher, ItemId, ForceNotify) ->
Action = fun(#pubsub_node{type = Type}) ->
Features = features(Type),
PersistentFeature = lists:member("persistent-items", Features),
DeleteFeature = lists:member("delete-any", Features),
DeleteFeature = lists:member("delete-items", Features),
if
%%-> iq_pubsub just does that matchs
%% %% Request does not specify an item
@ -1591,7 +1592,7 @@ delete_item(Host, Node, Publisher, ItemId, ForceNotify) ->
{error, extended_error('feature-not-implemented', unsupported, "persistent-items")};
not DeleteFeature ->
%% Service does not support item deletion
{error, extended_error('feature-not-implemented', unsupported, "delete-any")};
{error, extended_error('feature-not-implemented', unsupported, "delete-items")};
true ->
node_call(Type, delete_item, [Host, Node, Publisher, ItemId])
end
@ -1984,7 +1985,7 @@ get_subscriptions(Host, Node, JID) ->
if
not RetrieveFeature ->
%% Service does not support manage subscriptions
{error, extended_error('feature-not-implemented', unsupported, "manage-affiliations")};
{error, extended_error('feature-not-implemented', unsupported, "manage-subscriptions")};
Affiliation /= {result, owner} ->
%% Entity is not an owner
{error, 'forbidden'};
@ -2695,7 +2696,7 @@ features() ->
"config-node", % RECOMMENDED
"create-and-configure", % RECOMMENDED
% see plugin "create-nodes", % RECOMMENDED
% see plugin "delete-any", % RECOMMENDED
% see plugin "delete-items", % RECOMMENDED
% see plugin "delete-nodes", % RECOMMENDED
% see plugin "filtered-notifications", % RECOMMENDED
%TODO "get-pending", % OPTIONAL
@ -2747,7 +2748,7 @@ tree_call({_User, Server, _Resource}, Function, Args) ->
tree_call(Host, Function, Args) ->
Module = case ets:lookup(gen_mod:get_module_proc(Host, pubsub_state), nodetree) of
[{nodetree, N}] -> N;
_ -> list_to_atom(?TREE_PREFIX ++ ?STDNODE)
_ -> list_to_atom(?TREE_PREFIX ++ ?STDTREE)
end,
catch apply(Module, Function, Args).
tree_action(Host, Function, Args) ->

View File

@ -98,7 +98,7 @@ options() ->
features() ->
["create-nodes",
"delete-nodes",
"delete-any",
"delete-items",
"instant-nodes",
"item-ids",
"outcast-affiliation",

View File

@ -98,7 +98,7 @@ options() ->
features() ->
["create-nodes",
"delete-nodes",
"delete-any",
"delete-items",
"instant-nodes",
"outcast-affiliation",
"persistent-items",

View File

@ -160,7 +160,7 @@ features() ->
["create-nodes",
"auto-create",
"delete-nodes",
"delete-any",
"delete-items",
"instant-nodes",
"manage-subscriptions",
"modify-affiliations",

View File

@ -103,7 +103,7 @@ features() ->
"auto-create", %*
"auto-subscribe", %*
"delete-nodes", %*
"delete-any", %*
"delete-items", %*
"filtered-notifications", %*
"modify-affiliations",
"outcast-affiliation",

View File

@ -98,7 +98,7 @@ features() ->
"auto-create", %*
"auto-subscribe", %*
"delete-nodes", %*
"delete-any", %*
"delete-items", %*
"filtered-notifications", %*
"modify-affiliations",
"outcast-affiliation",

View File

@ -98,7 +98,7 @@ options() ->
features() ->
["create-nodes",
"delete-nodes",
"delete-any",
"delete-items",
"instant-nodes",
"outcast-affiliation",
"persistent-items",

View File

@ -98,7 +98,7 @@ options() ->
features() ->
["create-nodes",
"delete-nodes",
"delete-any",
"delete-items",
"instant-nodes",
"outcast-affiliation",
"persistent-items",