diff --git a/src/mod_pubsub/node_flat.erl b/src/mod_pubsub/node_flat.erl index 47e89da49..2ca038168 100644 --- a/src/mod_pubsub/node_flat.erl +++ b/src/mod_pubsub/node_flat.erl @@ -750,7 +750,7 @@ unsub_with_subid(NodeId, SubId, SubState) -> %% @doc

Returns a list of Owner's nodes on Host with pending %% subscriptions.

get_pending_nodes(Host, Owner) -> - GenKey = jlib:jid_remove_resource(jlib:jid_tolower(Owner)), + GenKey = jlib:short_prepd_bare_jid(Owner), States = mnesia:match_object(#pubsub_state{stateid = {GenKey, '_'}, affiliation = owner, _ = '_'}), diff --git a/src/mod_pubsub/node_hometree_odbc.erl b/src/mod_pubsub/node_hometree_odbc.erl index 6c4a56483..35004f4d3 100644 --- a/src/mod_pubsub/node_hometree_odbc.erl +++ b/src/mod_pubsub/node_hometree_odbc.erl @@ -694,8 +694,8 @@ get_entity_subscriptions(Host, Owner) -> %% nodes having send_last_published_item=on_sub_and_presence %% as this call avoid seeking node, it must return node and type as well get_entity_subscriptions_for_send_last(Host, Owner) -> - SubKey = jlib:jid_tolower(Owner), - GenKey = jlib:jid_remove_resource(SubKey), + SubKey = jlib:short_prepd_jid(Owner), + GenKey = jlib:short_prepd_bare_jid(Owner), H = ?PUBSUB:escape(Host), SJ = encode_jid(SubKey), GJ = encode_jid(GenKey), @@ -830,8 +830,7 @@ unsub_with_subid(NodeId, SubId, SubState) -> %% @doc

Returns a list of Owner's nodes on Host with pending %% subscriptions.

get_pending_nodes(Host, Owner) -> - %% pablo TODO, need to port those jlib:* calls to exmpp. Mnesia? - GenKey = jlib:jid_remove_resource(jlib:jid_tolower(Owner)), + KenKey = jlib:short_prepd_bare_jid(Owner), States = mnesia:match_object(#pubsub_state{stateid = {GenKey, '_'}, affiliation = owner, _ = '_'}), @@ -1306,7 +1305,7 @@ update_subscription(NodeId, JID, Subscription) -> "values('", NodeId, "', '", J, "', 'n', '", S, "');"]) end. -decode_jid(SJID) -> jlib:jid_tolower(jlib:string_to_jid(SJID)). +decode_jid(SJID) -> jlib:short_prepd_jid(jlib:string_to_jid(SJID)). decode_node(N) -> ?PUBSUB:string_to_node(N). diff --git a/src/mod_pubsub/node_pep.erl b/src/mod_pubsub/node_pep.erl index af862e1de..493de3904 100644 --- a/src/mod_pubsub/node_pep.erl +++ b/src/mod_pubsub/node_pep.erl @@ -175,9 +175,8 @@ purge_node(NodeId, Owner) -> node_flat:purge_node(NodeId, Owner). get_entity_affiliations(_Host, Owner) -> - {_, D, _} = SubKey = jlib:jid_tolower(Owner), - SubKey = jlib:jid_tolower(Owner), - GenKey = jlib:jid_remove_resource(SubKey), + {_, D, _} = SubKey = jlib:short_prepd_jid(Owner), + GenKey = jlib:short_prepd_bare_jid(Owner), States = mnesia:match_object(#pubsub_state{stateid = {GenKey, '_'}, _ = '_'}), NodeTree = case catch ets:lookup(gen_mod:get_module_proc(D, config), nodetree) of [{nodetree, N}] -> N; @@ -201,8 +200,8 @@ set_affiliation(NodeId, Owner, Affiliation) -> node_flat:set_affiliation(NodeId, Owner, Affiliation). get_entity_subscriptions(_Host, Owner) -> - {U, D, _} = SubKey = jlib:jid_tolower(Owner), - GenKey = jlib:jid_remove_resource(SubKey), + {U, D, _} = SubKey = jlib:short_prepd_jid(Owner), + GenKey = jlib:short_prepd_bare_jid(Owner), States = case SubKey of GenKey -> mnesia:match_object( #pubsub_state{stateid = {{U, D, '_'}, '_'}, _ = '_'}); diff --git a/src/mod_pubsub/nodetree_dag.erl b/src/mod_pubsub/nodetree_dag.erl index b4db80364..6713720bc 100644 --- a/src/mod_pubsub/nodetree_dag.erl +++ b/src/mod_pubsub/nodetree_dag.erl @@ -59,7 +59,7 @@ terminate(Host, ServerHost) -> nodetree_tree:terminate(Host, ServerHost). create_node(Key, NodeID, Type, Owner, Options, Parents) -> - OwnerJID = jlib:jid_tolower(jlib:jid_remove_resource(Owner)), + OwnerJID = jlib:short_prepd_bare_jid(Owner), case find_node(Key, NodeID) of false -> ID = pubsub_index:new(node),