aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2013-06-24 18:04:42 +0200
committerChristophe Romain <christophe.romain@process-one.net>2013-06-24 18:04:42 +0200
commit3976351c4d7766989fb5d543ffe294165bb367da (patch)
treee358f7681449ec4404ee44d07cc59a5758ce4deb
parentminor improvements and binary fix (diff)
decode_jid always gets binary(), encode_jid lets mod_pubsub handle conversion
-rw-r--r--src/node_hometree_odbc.erl13
1 files 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">>;