aboutsummaryrefslogtreecommitdiff
path: root/src/mod_muc_admin.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2020-11-19 09:31:14 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2020-11-19 09:31:14 +0100
commit9e1f3862cbdb8001da6c92558ac0c2a869664f15 (patch)
tree6b181e0544bf89e6f8b793680b400b15d3f1ddb1 /src/mod_muc_admin.erl
parentUpdate muc_room just_created timestamp when message is received (diff)
Fix room_unused_destroy on hibernated rooms
Diffstat (limited to '')
-rw-r--r--src/mod_muc_admin.erl17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl
index f818dd1ec..7de833cc2 100644
--- a/src/mod_muc_admin.erl
+++ b/src/mod_muc_admin.erl
@@ -932,13 +932,20 @@ act_on_rooms(Method, Action, Rooms) ->
end,
lists:foreach(Delete, Rooms).
-act_on_room(Method, destroy, {N, H, SH, Pid}) ->
+act_on_room(Method, destroy, {N, H, _SH, Pid}) ->
Message = iolist_to_binary(io_lib:format(
<<"Room destroyed by rooms_~s_destroy.">>, [Method])),
- mod_muc_room:destroy(Pid, Message),
- mod_muc:room_destroyed(H, N, Pid, SH),
- mod_muc:forget_room(SH, H, N);
-
+ case Pid of
+ V when is_pid(V) ->
+ mod_muc_room:destroy(Pid, Message);
+ _ ->
+ case get_room_pid(N, H) of
+ Pid2 when is_pid(Pid2) ->
+ mod_muc_room:destroy(Pid2, Message);
+ _ ->
+ ok
+ end
+ end;
act_on_room(_Method, list, _) ->
ok.