aboutsummaryrefslogtreecommitdiff
path: root/src/mod_muc_mnesia.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2017-04-20 16:49:32 +0200
committerBadlop <badlop@process-one.net>2017-04-20 16:49:32 +0200
commit4e86a71ab26e53d35aaf4dc1ba77a17314db145b (patch)
treef925f3281ef5997286d75149fb4994641e015c9a /src/mod_muc_mnesia.erl
parentmod_stream_mgmt: Preserve stanza count on timeout (diff)
When getting user rooms, filter by the serverhost as expected (#1683)
Diffstat (limited to 'src/mod_muc_mnesia.erl')
-rw-r--r--src/mod_muc_mnesia.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mod_muc_mnesia.erl b/src/mod_muc_mnesia.erl
index a87761665..6a9adf4b5 100644
--- a/src/mod_muc_mnesia.erl
+++ b/src/mod_muc_mnesia.erl
@@ -269,12 +269,13 @@ count_online_rooms_by_user(_ServerHost, U, S) ->
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">>,