U == U1 andalso S == S1
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(
muc_online_users,
ets:fun2ms(
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)).
import(_LServer, <<"muc_room">>,