25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Fix a confusion between #jid and tuples.

PR:		EJABP-1
Submitted by:	Pablo Polvorin <pablo.polvorin@process-one.net>

SVN Revision: 1604
This commit is contained in:
Jean-Sébastien Pédron 2008-10-06 15:00:34 +00:00
parent 01da93bf70
commit 5ceffdd5a7
2 changed files with 9 additions and 4 deletions

View File

@ -7,6 +7,9 @@
* src/ejabberd_c2s.erl (process_privacy_iq/4): mod_privacy & friends * src/ejabberd_c2s.erl (process_privacy_iq/4): mod_privacy & friends
may return an empty list. Thanks to Pablo Polvorin! may return an empty list. Thanks to Pablo Polvorin!
* src/mod_roster_odbc.erl (get_jid_info/4): Fix a confusion between
#jid and tuples. Thanks to Pablo Polvorin!
2008-10-02 Jean-Sébastien Pédron <js.pedron@meetic-corp.com> 2008-10-02 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* src/mod_roster_odbc.erl: Fix a bug where a JID represented as a * src/mod_roster_odbc.erl: Fix a bug where a JID represented as a

View File

@ -740,14 +740,15 @@ get_in_pending_subscriptions(Ls, User, Server) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% JID is #jid record, because it's used latter on for both short_prepd_jid
%% and short_prepd_bare_jid
get_jid_info(_, User, Server, JID) -> get_jid_info(_, User, Server, JID) ->
try try
LUser = exmpp_stringprep:nodeprep(User), LUser = exmpp_stringprep:nodeprep(User),
LServer = exmpp_stringprep:nameprep(Server), LServer = exmpp_stringprep:nameprep(Server),
LJID = jlib:short_prepd_jid(JID), LJID = {N, D, R} = jlib:short_prepd_jid(JID),
Username = ejabberd_odbc:escape(LUser), Username = ejabberd_odbc:escape(LUser),
SJID = ejabberd_odbc:escape(exmpp_jid:jid_to_list(LJID)), SJID = ejabberd_odbc:escape(exmpp_jid:jid_to_list(N, D, R)),
case catch odbc_queries:get_subscription(LServer, Username, SJID) of case catch odbc_queries:get_subscription(LServer, Username, SJID) of
{selected, ["subscription"], [{SSubscription}]} -> {selected, ["subscription"], [{SSubscription}]} ->
Subscription = case SSubscription of Subscription = case SSubscription of
@ -769,7 +770,8 @@ get_jid_info(_, User, Server, JID) ->
LRJID == LJID -> LRJID == LJID ->
{none, []}; {none, []};
true -> true ->
SRJID = ejabberd_odbc:escape(exmpp_jid:jid_to_list(LRJID)), {LR_N, LR_D, LR_R} = LRJID,
SRJID = ejabberd_odbc:escape(exmpp_jid:jid_to_list(LR_N, LR_D, LR_R)),
case catch odbc_queries:get_subscription(LServer, Username, SRJID) of case catch odbc_queries:get_subscription(LServer, Username, SRJID) of
{selected, ["subscription"], [{SSubscription}]} -> {selected, ["subscription"], [{SSubscription}]} ->
Subscription = case SSubscription of Subscription = case SSubscription of