summaryrefslogtreecommitdiff
path: root/src/mod_muc.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2016-09-19 12:35:53 +0200
committerBadlop <badlop@process-one.net>2016-09-19 12:35:53 +0200
commitf2cc81dfead352d4e8c4b3f546d1c2d734076c5c (patch)
tree3e9a78c98787de9fcc51906473e48565f01fc715 /src/mod_muc.erl
parentStore the Allow Subscription room option (#1301) (diff)
Fix getting of subscribed rooms: consider also temporary ones (#1242)
Diffstat (limited to 'src/mod_muc.erl')
-rw-r--r--src/mod_muc.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mod_muc.erl b/src/mod_muc.erl
index 4eb129a8..ad2be4cc 100644
--- a/src/mod_muc.erl
+++ b/src/mod_muc.erl
@@ -718,13 +718,12 @@ get_vh_rooms(Host, #rsm_in{max=M, direction=Direction, id=I, index=Index})->
index = NewIndex}}
end.
-get_subscribed_rooms(ServerHost, Host, From) ->
- Rooms = get_rooms(ServerHost, Host),
+get_subscribed_rooms(_ServerHost, Host1, From) ->
+ Rooms = get_vh_rooms(Host1),
BareFrom = jid:remove_resource(From),
lists:flatmap(
- fun(#muc_room{name_host = {Name, _}, opts = Opts}) ->
- Subscribers = proplists:get_value(subscribers, Opts, []),
- case lists:keymember(BareFrom, 1, Subscribers) of
+ fun(#muc_online_room{name_host = {Name, Host}, pid = Pid}) ->
+ case gen_fsm:sync_send_all_state_event(Pid, {is_subscribed, BareFrom}) of
true -> [jid:make(Name, Host, <<>>)];
false -> []
end;