25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

When getting user rooms, filter by the serverhost as expected (#1683)

This commit is contained in:
Badlop 2017-04-20 16:49:32 +02:00
parent 3682888655
commit 4e86a71ab2

View File

@ -269,12 +269,13 @@ count_online_rooms_by_user(_ServerHost, U, S) ->
U == U1 andalso S == S1 U == U1 andalso S == S1
end)). end)).
get_online_rooms_by_user(_ServerHost, U, S) -> get_online_rooms_by_user(ServerHost, U, S) ->
MucHost = gen_mod:get_module_opt_host(ServerHost, mod_muc, <<"conference.@HOST@">>),
ets:select( ets:select(
muc_online_users, muc_online_users,
ets:fun2ms( ets:fun2ms(
fun(#muc_online_users{us = {U1, S1}, room = Room, host = Host}) fun(#muc_online_users{us = {U1, S1}, room = Room, host = Host})
when U == U1 andalso S == S1 -> {Room, Host} when U == U1 andalso S == S1 andalso MucHost == Host -> {Room, Host}
end)). end)).
import(_LServer, <<"muc_room">>, import(_LServer, <<"muc_room">>,