mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +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:
parent
07651d712f
commit
999f3233bb
@ -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 <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/ejabberd_c2s.erl: The handle_info clause that treats routing
|
||||
|
@ -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};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user