Skip to content

Commit

Permalink
DEBUG get_Vh_room
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Jul 31, 2023
1 parent 5b11bf6 commit 6df515b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mod_muc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,9 @@ broadcast_service_message(MucHost, Msg) ->
-spec get_vh_rooms(muc_host()) -> [muc_online_room()].
get_vh_rooms(MucHost) ->
{ok, HostType} = mongoose_domain_api:get_subdomain_host_type(MucHost),
mongoose_muc_online_backend:get_online_rooms(HostType, MucHost).
Res = mongoose_muc_online_backend:get_online_rooms(HostType, MucHost),
?LOG_ERROR(#{what => get_vh_rooms, res => Res, muc_host => MucHost, host_type => HostType}),
Res.

-spec get_persistent_vh_rooms(muc_host()) -> [muc_room()].
get_persistent_vh_rooms(MucHost) ->
Expand Down
5 changes: 4 additions & 1 deletion src/mod_muc_api.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%% @doc Provide an interface for frontends (like graphql or ctl) to manage MUC rooms.
-module(mod_muc_api).
-include_lib("kernel/include/logger.hrl").

-export([get_rooms/4,
get_room_config/1,
Expand Down Expand Up @@ -68,8 +69,10 @@
non_neg_integer()) -> {ok, get_rooms_result()} | {muc_server_not_found, iolist()}.
get_rooms(MUCServer, From, Limit, Index) ->
case mongoose_domain_api:get_subdomain_host_type(MUCServer) of
{ok, _HostType} ->
{ok, HostType} ->
Ress =
{Rooms, RSM} = mod_muc:get_vh_rooms(MUCServer, #rsm_in{max = Limit, index = Index}),
?LOG_ERROR(#{what => get_vh_rooms_api, res => Ress, muc_host => MUCServer, host_type => HostType}),
Rooms2 = lists:filtermap(fun(R) -> room_to_item(R, MUCServer, From) end, Rooms),
{ok, {Rooms2, RSM}};
{error, not_found} ->
Expand Down

0 comments on commit 6df515b

Please sign in to comment.