summaryrefslogtreecommitdiff
path: root/src/node_flat.erl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/node_flat.erl58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/node_flat.erl b/src/node_flat.erl
index 6388dfc5..a003642f 100644
--- a/src/node_flat.erl
+++ b/src/node_flat.erl
@@ -116,7 +116,7 @@ features() ->
%% checked. This parameter depends on the value of the
%% <tt>access_createnode</tt> ACL value in ejabberd config file.</p>
create_node_permission(Host, ServerHost, _Node, _ParentNode, Owner, Access) ->
- LOwner = jlib:jid_tolower(Owner),
+ LOwner = jid:tolower(Owner),
Allowed = case LOwner of
{<<"">>, Host, <<"">>} ->
true; % pubsub service always allowed
@@ -126,7 +126,7 @@ create_node_permission(Host, ServerHost, _Node, _ParentNode, Owner, Access) ->
{result, Allowed}.
create_node(Nidx, Owner) ->
- OwnerKey = jlib:jid_tolower(jlib:jid_remove_resource(Owner)),
+ OwnerKey = jid:tolower(jid:remove_resource(Owner)),
set_state(#pubsub_state{stateid = {OwnerKey, Nidx},
affiliation = owner}),
{result, {default, broadcast}}.
@@ -178,9 +178,9 @@ delete_node(Nodes) ->
%% <p>In the default plugin module, the record is unchanged.</p>
subscribe_node(Nidx, Sender, Subscriber, AccessModel,
SendLast, PresenceSubscription, RosterGroup, Options) ->
- SubKey = jlib:jid_tolower(Subscriber),
- GenKey = jlib:jid_remove_resource(SubKey),
- Authorized = jlib:jid_tolower(jlib:jid_remove_resource(Sender)) == GenKey,
+ SubKey = jid:tolower(Subscriber),
+ GenKey = jid:remove_resource(SubKey),
+ Authorized = jid:tolower(jid:remove_resource(Sender)) == GenKey,
GenState = get_state(Nidx, GenKey),
SubState = case SubKey of
GenKey -> GenState;
@@ -238,9 +238,9 @@ subscribe_node(Nidx, Sender, Subscriber, AccessModel,
%% @doc <p>Unsubscribe the <tt>Subscriber</tt> from the <tt>Node</tt>.</p>
unsubscribe_node(Nidx, Sender, Subscriber, SubId) ->
- SubKey = jlib:jid_tolower(Subscriber),
- GenKey = jlib:jid_remove_resource(SubKey),
- Authorized = jlib:jid_tolower(jlib:jid_remove_resource(Sender)) == GenKey,
+ SubKey = jid:tolower(Subscriber),
+ GenKey = jid:remove_resource(SubKey),
+ Authorized = jid:tolower(jid:remove_resource(Sender)) == GenKey,
GenState = get_state(Nidx, GenKey),
SubState = case SubKey of
GenKey -> GenState;
@@ -340,8 +340,8 @@ delete_subscriptions(SubKey, Nidx, Subscriptions, SubState) ->
%% </p>
%% <p>In the default plugin module, the record is unchanged.</p>
publish_item(Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload) ->
- SubKey = jlib:jid_tolower(Publisher),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(Publisher),
+ GenKey = jid:remove_resource(SubKey),
GenState = get_state(Nidx, GenKey),
SubState = case SubKey of
GenKey -> GenState;
@@ -406,8 +406,8 @@ remove_extra_items(Nidx, MaxItems, ItemIds) ->
%% <p>Default plugin: The user performing the deletion must be the node owner
%% or a publisher, or PublishModel being open.</p>
delete_item(Nidx, Publisher, PublishModel, ItemId) ->
- SubKey = jlib:jid_tolower(Publisher),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(Publisher),
+ GenKey = jid:remove_resource(SubKey),
GenState = get_state(Nidx, GenKey),
#pubsub_state{affiliation = Affiliation, items = Items} = GenState,
Allowed = Affiliation == publisher orelse
@@ -451,8 +451,8 @@ delete_item(Nidx, Publisher, PublishModel, ItemId) ->
end.
purge_node(Nidx, Owner) ->
- SubKey = jlib:jid_tolower(Owner),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(Owner),
+ GenKey = jid:remove_resource(SubKey),
GenState = get_state(Nidx, GenKey),
case GenState of
#pubsub_state{affiliation = owner} ->
@@ -478,8 +478,8 @@ purge_node(Nidx, Owner) ->
%% that will be added to the affiliation stored in the main
%% <tt>pubsub_state</tt> table.</p>
get_entity_affiliations(Host, Owner) ->
- SubKey = jlib:jid_tolower(Owner),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(Owner),
+ GenKey = jid:remove_resource(SubKey),
States = mnesia:match_object(#pubsub_state{stateid = {GenKey, '_'}, _ = '_'}),
NodeTree = mod_pubsub:tree(Host),
Reply = lists:foldl(fun (#pubsub_state{stateid = {_, N}, affiliation = A}, Acc) ->
@@ -497,14 +497,14 @@ get_node_affiliations(Nidx) ->
{result, lists:map(Tr, States)}.
get_affiliation(Nidx, Owner) ->
- SubKey = jlib:jid_tolower(Owner),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(Owner),
+ GenKey = jid:remove_resource(SubKey),
#pubsub_state{affiliation = Affiliation} = get_state(Nidx, GenKey),
{result, Affiliation}.
set_affiliation(Nidx, Owner, Affiliation) ->
- SubKey = jlib:jid_tolower(Owner),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(Owner),
+ GenKey = jid:remove_resource(SubKey),
GenState = get_state(Nidx, GenKey),
case {Affiliation, GenState#pubsub_state.subscriptions} of
{none, []} -> del_state(Nidx, GenKey);
@@ -519,8 +519,8 @@ set_affiliation(Nidx, Owner, Affiliation) ->
%% that will be added to the affiliation stored in the main
%% <tt>pubsub_state</tt> table.</p>
get_entity_subscriptions(Host, Owner) ->
- {U, D, _} = SubKey = jlib:jid_tolower(Owner),
- GenKey = jlib:jid_remove_resource(SubKey),
+ {U, D, _} = SubKey = jid:tolower(Owner),
+ GenKey = jid:remove_resource(SubKey),
States = case SubKey of
GenKey ->
mnesia:match_object(#pubsub_state{stateid = {{U, D, '_'}, '_'}, _ = '_'});
@@ -562,12 +562,12 @@ get_node_subscriptions(Nidx) ->
{result, lists:flatmap(Tr, States)}.
get_subscriptions(Nidx, Owner) ->
- SubKey = jlib:jid_tolower(Owner),
+ SubKey = jid:tolower(Owner),
SubState = get_state(Nidx, SubKey),
{result, SubState#pubsub_state.subscriptions}.
set_subscriptions(Nidx, Owner, Subscription, SubId) ->
- SubKey = jlib:jid_tolower(Owner),
+ SubKey = jid:tolower(Owner),
SubState = get_state(Nidx, SubKey),
case {SubId, SubState#pubsub_state.subscriptions} of
{_, []} ->
@@ -620,7 +620,7 @@ unsub_with_subid(Nidx, SubId, #pubsub_state{stateid = {Entity, _}} = SubState) -
%% @doc <p>Returns a list of Owner's nodes on Host with pending
%% subscriptions.</p>
get_pending_nodes(Host, Owner) ->
- GenKey = jlib:jid_remove_resource(jlib:jid_tolower(Owner)),
+ GenKey = jid:remove_resource(jid:tolower(Owner)),
States = mnesia:match_object(#pubsub_state{stateid = {GenKey, '_'},
affiliation = owner,
_ = '_'}),
@@ -702,8 +702,8 @@ get_items(Nidx, _From, _RSM) ->
{result, {lists:reverse(lists:keysort(#pubsub_item.modification, Items)), none}}.
get_items(Nidx, JID, AccessModel, PresenceSubscription, RosterGroup, _SubId, RSM) ->
- SubKey = jlib:jid_tolower(JID),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(JID),
+ GenKey = jid:remove_resource(SubKey),
GenState = get_state(Nidx, GenKey),
SubState = get_state(Nidx, SubKey),
Affiliation = GenState#pubsub_state.affiliation,
@@ -746,8 +746,8 @@ get_item(Nidx, ItemId) ->
end.
get_item(Nidx, ItemId, JID, AccessModel, PresenceSubscription, RosterGroup, _SubId) ->
- SubKey = jlib:jid_tolower(JID),
- GenKey = jlib:jid_remove_resource(SubKey),
+ SubKey = jid:tolower(JID),
+ GenKey = jid:remove_resource(SubKey),
GenState = get_state(Nidx, GenKey),
Affiliation = GenState#pubsub_state.affiliation,
Subscriptions = GenState#pubsub_state.subscriptions,