diff --git a/ChangeLog b/ChangeLog index 9790c3f08..e49553877 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * src/ejabberd_c2s.erl: Finish ejabberd_c2s conversion with the 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 * src/ejabberd_c2s.erl: The handle_info clause that treats routing diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 1f87d2a25..c847506be 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -981,16 +981,13 @@ handle_sync_event({get_presence}, _From, StateName, StateData) -> handle_sync_event(get_subscribed_and_online, _From, StateName, StateData) -> Subscribed = StateData#state.pres_f, Online = StateData#state.pres_available, + % XXX OLF FORMAT: short JID with empty string(s). Pred = fun({U, S, _R} = User, _Caps) -> - ?SETS:is_element({U, S, undefined}, + ?SETS:is_element({U, S, ""}, Subscribed) orelse ?SETS:is_element(User, Subscribed) end, - % XXX OLD FORMAT: Resource is "". - Old = fun({U, S, undefined}, _Caps) -> {U, S, ""}; - (User, _Caps) -> User - end, - SubscribedAndOnline = ?DICT:map(Old, ?DICT:filter(Pred, Online)), + SubscribedAndOnline = ?DICT:filter(Pred, Online), io:format("===== SubscribedAndOnline = ~p~n", [SubscribedAndOnline]), {reply, ?DICT:to_list(SubscribedAndOnline), StateName, StateData};