diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-11-16 15:25:01 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-11-16 16:05:16 +0100 |
commit | 2e8023158d068413101639a4e91f53de08282b0f (patch) | |
tree | b345d905fcba59b018ce7f4325ec10875888282f /src/mod_muc_room.erl | |
parent | Merge pull request #3399 from nosnilmot/redis3-configure_deps (diff) |
Allow room_unused_list/destroy work on hibernated rooms
This required adding hibernation time to data stored for room to be able
determine how old was a room, rooms that aren't stored with that
information will use node start time as timestamp for that.
Diffstat (limited to 'src/mod_muc_room.erl')
-rw-r--r-- | src/mod_muc_room.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index dbabbc0d..87e378bb 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -3951,6 +3951,7 @@ make_opts(StateData) -> maps:to_list(StateData#state.affiliations)}, {subject, StateData#state.subject}, {subject_author, StateData#state.subject_author}, + {hibernation_time, erlang:system_time(microsecond)}, {subscribers, Subscribers}]. expand_opts(CompactOpts) -> @@ -3974,13 +3975,15 @@ expand_opts(CompactOpts) -> SubjectAuthor = proplists:get_value(subject_author, CompactOpts, <<"">>), Subject = proplists:get_value(subject, CompactOpts, <<"">>), Subscribers = proplists:get_value(subscribers, CompactOpts, []), + HibernationTime = proplists:get_value(hibernation_time, CompactOpts, 0), [{subject, Subject}, {subject_author, SubjectAuthor}, - {subscribers, Subscribers} + {subscribers, Subscribers}, + {hibernation_time, HibernationTime} | lists:reverse(Opts1)]. config_fields() -> - [subject, subject_author, subscribers | record_info(fields, config)]. + [subject, subject_author, subscribers, hibernate_time | record_info(fields, config)]. -spec destroy_room(muc_destroy(), state()) -> {result, undefined, stop}. destroy_room(DEl, StateData) -> |