mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
EJAB-469 bugfix
SVN Revision: 1097
This commit is contained in:
parent
02eaf9eaec
commit
d74c527101
@ -5,7 +5,7 @@
|
|||||||
* src/ejabberd_c2s.erl: Likewise
|
* src/ejabberd_c2s.erl: Likewise
|
||||||
|
|
||||||
* src/mod_pubsub/mod_pubsub.erl: send last pep item bugfix and
|
* src/mod_pubsub/mod_pubsub.erl: send last pep item bugfix and
|
||||||
broadcast optimization (EJAB-468) (EJAB-467) (EJAB-460)
|
broadcast optimization (EJAB-468) (EJAB-467) (EJAB-460) (EJAB-469)
|
||||||
* src/mod_pubsub/pubsub.hrl: Likewise
|
* src/mod_pubsub/pubsub.hrl: Likewise
|
||||||
* src/mod_pubsub/node_default.erl: Likewise
|
* src/mod_pubsub/node_default.erl: Likewise
|
||||||
|
|
||||||
|
@ -1687,6 +1687,7 @@ send_items(Host, Node, LJID, Number) ->
|
|||||||
%% Response = [pubsubIQResponse()]
|
%% Response = [pubsubIQResponse()]
|
||||||
%% @doc <p>Return the list of affiliations as an XMPP response.</p>
|
%% @doc <p>Return the list of affiliations as an XMPP response.</p>
|
||||||
get_affiliations(Host, JID, Plugins) when is_list(Plugins) ->
|
get_affiliations(Host, JID, Plugins) when is_list(Plugins) ->
|
||||||
|
?INFO_MSG("**1 ~p",[{Host,JID,Plugins}]),
|
||||||
Result = lists:foldl(
|
Result = lists:foldl(
|
||||||
fun(Type, {Status, Acc}) ->
|
fun(Type, {Status, Acc}) ->
|
||||||
Features = features(Type),
|
Features = features(Type),
|
||||||
|
@ -143,6 +143,7 @@ features() ->
|
|||||||
"instant-nodes",
|
"instant-nodes",
|
||||||
"item-ids",
|
"item-ids",
|
||||||
"manage-subscriptions",
|
"manage-subscriptions",
|
||||||
|
"modify-affiliations",
|
||||||
"outcast-affiliation",
|
"outcast-affiliation",
|
||||||
"persistent-items",
|
"persistent-items",
|
||||||
"publish",
|
"publish",
|
||||||
|
@ -75,8 +75,11 @@ options() ->
|
|||||||
features() ->
|
features() ->
|
||||||
["create-nodes", %*
|
["create-nodes", %*
|
||||||
"auto-create", %*
|
"auto-create", %*
|
||||||
|
"auto-subscribe", %*
|
||||||
"delete-nodes", %*
|
"delete-nodes", %*
|
||||||
|
"filtered-notifications", %*
|
||||||
"item-ids",
|
"item-ids",
|
||||||
|
"modify-affiliations",
|
||||||
"outcast-affiliation",
|
"outcast-affiliation",
|
||||||
"persistent-items",
|
"persistent-items",
|
||||||
"publish", %*
|
"publish", %*
|
||||||
@ -85,9 +88,7 @@ features() ->
|
|||||||
"retrieve-affiliations",
|
"retrieve-affiliations",
|
||||||
"retrieve-items", %*
|
"retrieve-items", %*
|
||||||
"retrieve-subscriptions",
|
"retrieve-subscriptions",
|
||||||
"subscribe", %*
|
"subscribe" %*
|
||||||
"auto-subscribe", %*
|
|
||||||
"filtered-notifications" %*
|
|
||||||
].
|
].
|
||||||
|
|
||||||
create_node_permission(_Host, _ServerHost, _Node, _ParentNode, _Owner, _Access) ->
|
create_node_permission(_Host, _ServerHost, _Node, _ParentNode, _Owner, _Access) ->
|
||||||
@ -133,16 +134,30 @@ purge_node(Host, Node, Owner) ->
|
|||||||
get_entity_affiliations(_Host, Owner) ->
|
get_entity_affiliations(_Host, Owner) ->
|
||||||
OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)),
|
OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)),
|
||||||
node_default:get_entity_affiliations(OwnerKey, Owner).
|
node_default:get_entity_affiliations(OwnerKey, Owner).
|
||||||
%{result, []}.
|
|
||||||
|
|
||||||
get_node_affiliations(_Host, _Node) ->
|
get_node_affiliations(_Host, Node) ->
|
||||||
{result, []}.
|
States = mnesia:match_object(
|
||||||
|
#pubsub_state{stateid = {'_', {'_', Node}},
|
||||||
|
_ = '_'}),
|
||||||
|
Tr = fun(#pubsub_state{stateid = {J, {_, _}}, affiliation = A}) ->
|
||||||
|
{J, A}
|
||||||
|
end,
|
||||||
|
{result, lists:map(Tr, States)}.
|
||||||
|
|
||||||
get_affiliation(_Host, Node, Owner) ->
|
get_affiliation(_Host, Node, Owner) ->
|
||||||
OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)),
|
OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)),
|
||||||
node_default:get_affiliation(OwnerKey, Node, Owner).
|
node_default:get_affiliation(OwnerKey, Node, Owner).
|
||||||
|
|
||||||
set_affiliation(_Host, _Node, _Owner, _Affiliation) ->
|
set_affiliation(_Host, Node, Owner, Affiliation) ->
|
||||||
|
OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)),
|
||||||
|
Record = case get_state(OwnerKey, Node, OwnerKey) of
|
||||||
|
{error, ?ERR_ITEM_NOT_FOUND} ->
|
||||||
|
#pubsub_state{stateid = {OwnerKey, {OwnerKey, Node}},
|
||||||
|
affiliation = Affiliation};
|
||||||
|
{result, State} ->
|
||||||
|
State#pubsub_state{affiliation = Affiliation}
|
||||||
|
end,
|
||||||
|
set_state(Record),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
get_entity_subscriptions(_Host, _Owner) ->
|
get_entity_subscriptions(_Host, _Owner) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user