From 3976351c4d7766989fb5d543ffe294165bb367da Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Mon, 24 Jun 2013 18:04:42 +0200 Subject: [PATCH] decode_jid always gets binary(), encode_jid lets mod_pubsub handle conversion --- src/node_hometree_odbc.erl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/node_hometree_odbc.erl b/src/node_hometree_odbc.erl index a8aef4b56..1a0832c09 100644 --- a/src/node_hometree_odbc.erl +++ b/src/node_hometree_odbc.erl @@ -1605,10 +1605,8 @@ update_subscription(NodeId, JID, Subscription) -> S, <<"');">>]) end. -decode_jid(SJID) when is_list(SJID) -> - jlib:jid_tolower(jlib:string_to_jid(SJID)); -decode_jid(BJID) when is_binary(BJID) -> - decode_jid(binary_to_list(BJID)). +decode_jid(JID) -> + jlib:jid_tolower(jlib:string_to_jid(JID)). decode_affiliation(<<"o">>) -> owner; decode_affiliation(<<"p">>) -> publisher; @@ -1630,13 +1628,8 @@ decode_subscriptions(Subscriptions) -> end, [], str:tokens(Subscriptions, <<",">>)). -%-spec(encode_jid/1 :: -%( -% JID :: jid() | jid()) -% -> binary() -%). encode_jid(JID) -> - (?PUBSUB):escape(jlib:jid_to_string(JID)). + (?PUBSUB):escape(JID). encode_affiliation(owner) -> <<"o">>; encode_affiliation(publisher) -> <<"p">>;