diff options
author | Vitaly Takmazov | 2023-12-04 07:39:21 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-12-08 13:11:35 +0300 |
commit | a695bb077af4f34bd0a085fe077bee39d0fa5d1e (patch) | |
tree | 29a30fe38f39c6ee2039bf1b8ba9a7b3e7871fc1 | |
parent | a7df88dbbf9ebe9b703d984c5ab59b8af2769d2e (diff) |
Increase message editing window to 3 days
-rw-r--r-- | src/main/java/com/juick/service/MessagesServiceImpl.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index 8b729c60..454b2aa0 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -1082,7 +1082,8 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ @Override public boolean updateMessage(Integer mid, Integer rid, String body, boolean foreign) { Instant now = Instant.now(); - Instant messageEditingWindow = now.minus(15, ChronoUnit.MINUTES); + Instant messageEditingWindow = now.minus(3, ChronoUnit.DAYS); + Instant replyEditingWindow = now.minus(15, ChronoUnit.MINUTES); if (rid == 0) { Optional<Message> message = getMessage(mid); if (message.isPresent()) { @@ -1101,7 +1102,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ Message reply = getReply(mid, rid); if (reply != null) { Instant ts = reply.getUpdatedAt(); - if (ts.compareTo(messageEditingWindow) >= 0 || foreign) { + if (ts.compareTo(replyEditingWindow) >= 0 || foreign) { return namedParameterJdbcTemplate.update( "UPDATE replies SET txt=:txt, updated_at=:now WHERE message_id=:mid AND reply_id=:rid", new MapSqlParameterSource() |