aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'juick-common/src/main/java/com/juick')
-rw-r--r--juick-common/src/main/java/com/juick/Message.java18
-rw-r--r--juick-common/src/main/java/com/juick/service/MessagesService.java3
2 files changed, 21 insertions, 0 deletions
diff --git a/juick-common/src/main/java/com/juick/Message.java b/juick-common/src/main/java/com/juick/Message.java
index 3800f466..212cb2fa 100644
--- a/juick-common/src/main/java/com/juick/Message.java
+++ b/juick-common/src/main/java/com/juick/Message.java
@@ -46,6 +46,7 @@ public class Message implements Comparable {
private final List<Tag> tags;
private Instant ts;
private Instant updated;
+ private Instant updatedAt;
private boolean unread;
@JsonIgnore
private int privacy = 1;
@@ -281,6 +282,9 @@ public class Message implements Comparable {
this.attachment = attachment;
}
+ /**
+ * @return timestamp of the last comment
+ */
@XmlTransient
public Instant getUpdated() {
return updated;
@@ -329,4 +333,18 @@ public class Message implements Comparable {
public void setRecommendations(Set<String> recommendations) {
this.recommendations = recommendations;
}
+
+ /**
+ * @return timestamp of the last edit
+ */
+ @XmlTransient
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTC")
+ @JsonProperty("updated_at")
+ public Instant getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(Instant updatedAt) {
+ this.updatedAt = updatedAt;
+ }
}
diff --git a/juick-common/src/main/java/com/juick/service/MessagesService.java b/juick-common/src/main/java/com/juick/service/MessagesService.java
index 28f59153..202e967e 100644
--- a/juick-common/src/main/java/com/juick/service/MessagesService.java
+++ b/juick-common/src/main/java/com/juick/service/MessagesService.java
@@ -17,6 +17,7 @@
package com.juick.service;
+import com.juick.Message;
import com.juick.Reaction;
import com.juick.User;
import com.juick.server.helpers.ResponseReply;
@@ -126,4 +127,6 @@ public interface MessagesService {
void setRead(User user, Integer mid);
List<Integer> getUnread(User user);
+
+ boolean updateMessage(Integer mid, Integer rid, String body);
}