aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java5
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()