aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/model/Message.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-06-25 08:33:55 +0300
committerGravatar Vitaly Takmazov2022-06-25 08:33:55 +0300
commit7692b9f126de590d8d1db3e4bed2b4c9c1345e25 (patch)
tree019b570e5d01a639c3b37b8c2779576ba397235a /src/main/java/com/juick/model/Message.java
parent0e99af4f3a5e7c3941750de4709f69337f9f7d0f (diff)
`likes` field returns recommendations count
Diffstat (limited to 'src/main/java/com/juick/model/Message.java')
-rw-r--r--src/main/java/com/juick/model/Message.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/com/juick/model/Message.java b/src/main/java/com/juick/model/Message.java
index 0ae756b1..2a5883ac 100644
--- a/src/main/java/com/juick/model/Message.java
+++ b/src/main/java/com/juick/model/Message.java
@@ -71,7 +71,6 @@ public class Message implements Comparable<Message>, Serializable {
private Photo photo;
@XmlTransient
private Attachment attachment;
- private int likes;
private User to;
private String replyQuote;
@XmlTransient
@@ -88,6 +87,7 @@ public class Message implements Comparable<Message>, Serializable {
public Message() {
tags = new LinkedHashSet<>();
reactions = new HashSet<>();
+ recommendations = new HashSet<>();
}
@Override
@@ -102,7 +102,7 @@ public class Message implements Comparable<Message>, Serializable {
.append("Hidden", Hidden)
.append("VisitorCanComment", VisitorCanComment)
.append("replies", replies)
- .append("likes", likes)
+ .append("likes", getLikes())
.append("reactions", reactions)
.toString();
}
@@ -260,11 +260,7 @@ public class Message implements Comparable<Message>, Serializable {
@XmlTransient
@Deprecated
public int getLikes() {
- return likes;
- }
-
- public void setLikes(int likes) {
- this.likes = likes;
+ return recommendations.size();
}
@JsonProperty("repliesby")