25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Fix short JID comparison in get_subscribed_and_online; it was using

'undefined' instead of empty strings.

SVN Revision: 1381
This commit is contained in:
Jean-Sébastien Pédron 2008-06-25 13:27:03 +00:00
parent 07651d712f
commit 999f3233bb
2 changed files with 6 additions and 6 deletions

View File

@ -3,6 +3,9 @@
* src/ejabberd_c2s.erl: Finish ejabberd_c2s conversion with the * src/ejabberd_c2s.erl: Finish ejabberd_c2s conversion with the
functions related to offline stanzas. functions related to offline stanzas.
* src/ejabberd_c2s.erl (get_subscribed_and_online): Fix short JID
comparison; it was using 'undefined' instead of empty strings.
2008-06-24 Jean-Sébastien Pédron <js.pedron@meetic-corp.com> 2008-06-24 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* src/ejabberd_c2s.erl: The handle_info clause that treats routing * src/ejabberd_c2s.erl: The handle_info clause that treats routing

View File

@ -981,16 +981,13 @@ handle_sync_event({get_presence}, _From, StateName, StateData) ->
handle_sync_event(get_subscribed_and_online, _From, StateName, StateData) -> handle_sync_event(get_subscribed_and_online, _From, StateName, StateData) ->
Subscribed = StateData#state.pres_f, Subscribed = StateData#state.pres_f,
Online = StateData#state.pres_available, Online = StateData#state.pres_available,
% XXX OLF FORMAT: short JID with empty string(s).
Pred = fun({U, S, _R} = User, _Caps) -> Pred = fun({U, S, _R} = User, _Caps) ->
?SETS:is_element({U, S, undefined}, ?SETS:is_element({U, S, ""},
Subscribed) orelse Subscribed) orelse
?SETS:is_element(User, Subscribed) ?SETS:is_element(User, Subscribed)
end, end,
% XXX OLD FORMAT: Resource is "". SubscribedAndOnline = ?DICT:filter(Pred, Online),
Old = fun({U, S, undefined}, _Caps) -> {U, S, ""};
(User, _Caps) -> User
end,
SubscribedAndOnline = ?DICT:map(Old, ?DICT:filter(Pred, Online)),
io:format("===== SubscribedAndOnline = ~p~n", [SubscribedAndOnline]), io:format("===== SubscribedAndOnline = ~p~n", [SubscribedAndOnline]),
{reply, ?DICT:to_list(SubscribedAndOnline), StateName, StateData}; {reply, ?DICT:to_list(SubscribedAndOnline), StateName, StateData};