diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-11-18 17:14:28 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-11-18 17:14:28 +0100 |
commit | c2a3f037bb6e6651ffb2df6ad093cb5a2cb06b61 (patch) | |
tree | 1639fe924b8b6a2fc85d5f4905cd1585550b3441 /src/mod_muc_room.erl | |
parent | We don't use persistent field in decide_room (diff) |
Update muc_room just_created timestamp when message is received
This together with last history message is used by room_unused_* command
to determine for how long room was not used, this change allow us to skip
checking history, and works even when history is disabled.
Diffstat (limited to 'src/mod_muc_room.erl')
-rw-r--r-- | src/mod_muc_room.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 87e378bb..1235db78 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -2720,9 +2720,9 @@ add_message_to_history(FromNick, FromJID, Packet, StateData) -> Q1 = lqueue_in({FromNick, TSPacket, false, TimeStamp, Size}, StateData#state.history), - StateData#state{history = Q1}; + StateData#state{history = Q1, just_created = erlang:system_time(microsecond)}; _ -> - StateData + StateData#state{just_created = erlang:system_time(microsecond)} end. -spec send_history(jid(), [lqueue_elem()], state()) -> ok. |