aboutsummaryrefslogtreecommitdiff
path: root/juick-common
diff options
context:
space:
mode:
Diffstat (limited to 'juick-common')
-rw-r--r--juick-common/src/main/java/com/juick/server/CommandsManager.java4
-rw-r--r--juick-common/src/main/java/com/juick/service/MessagesService.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/juick-common/src/main/java/com/juick/server/CommandsManager.java b/juick-common/src/main/java/com/juick/server/CommandsManager.java
index d924ac70..734d68fb 100644
--- a/juick-common/src/main/java/com/juick/server/CommandsManager.java
+++ b/juick-common/src/main/java/com/juick/server/CommandsManager.java
@@ -388,7 +388,7 @@ public class CommandsManager {
com.juick.Message msg = messagesService.getMessage(mid);
if (msg != null) {
if (showReplies) {
- List<com.juick.Message> replies = messagesService.getReplies(mid);
+ List<com.juick.Message> replies = messagesService.getReplies(user, mid);
replies.add(0, msg);
return CommandResult.fromString(String.join("\n",
replies.stream().map(PlainTextFormatter::formatPostSummary).collect(Collectors.toList())));
@@ -477,7 +477,7 @@ public class CommandsManager {
} else {
String attachmentStr = attachment.toString();
String attachmentType = StringUtils.isNotEmpty(attachmentStr) ? attachmentStr.substring(attachmentStr.length() - 3) : null;
- int newrid = messagesService.createReply(mid, rid, user.getUid(), txt, attachmentType);
+ int newrid = messagesService.createReply(mid, rid, user, txt, attachmentType);
if (StringUtils.isNotEmpty(attachmentType)) {
String attachmentFName = attachment.getScheme().equals("juick") ? attachment.getHost()
: HttpUtils.downloadImage(attachment.toURL(), tmpDir).getHost();
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 2dce2806..968e64be 100644
--- a/juick-common/src/main/java/com/juick/service/MessagesService.java
+++ b/juick-common/src/main/java/com/juick/service/MessagesService.java
@@ -29,7 +29,7 @@ import java.util.List;
public interface MessagesService {
int createMessage(int uid, String txt, String attachment, Collection<com.juick.Tag> tags);
- int createReply(int mid, int rid, int uid, String txt, String attachment);
+ int createReply(int mid, int rid, User user, String txt, String attachment);
int getReplyIDIncrement(int mid);
@@ -95,7 +95,7 @@ public interface MessagesService {
List<com.juick.Message> getMessages(List<Integer> mids);
- List<com.juick.Message> getReplies(int mid);
+ List<com.juick.Message> getReplies(User user, int mid);
boolean setMessagePopular(int mid, int popular);
@@ -110,4 +110,6 @@ public interface MessagesService {
List<ResponseReply> getLastReplies(int hours);
List<Integer> getPopularCandidates();
+
+ void setLastReadComment(User user, Integer mid, Integer rid);
}