aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-30 10:37:29 +0300
committerGravatar Vitaly Takmazov2018-05-30 10:37:29 +0300
commit485600a958c13707e9a1d4940e254f449ecab8ca (patch)
treefa42d850896a564f19974c8871b452a40db2bb32 /juick-server/src/main/java/com/juick
parentccc5f4479302094b9eed1878e0ab5c4d849c57a6 (diff)
api: do not publish read events from anonymous
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Messages.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Messages.java b/juick-server/src/main/java/com/juick/server/api/Messages.java
index b4d16937..e100802f 100644
--- a/juick-server/src/main/java/com/juick/server/api/Messages.java
+++ b/juick-server/src/main/java/com/juick/server/api/Messages.java
@@ -150,7 +150,9 @@ public class Messages {
return FORBIDDEN;
} else {
List<com.juick.Message> replies = messagesService.getReplies(visitor, mid);
- applicationEventPublisher.publishEvent(new MessageReadEvent(this, visitor, msg));
+ if (!visitor.isAnonymous()) {
+ applicationEventPublisher.publishEvent(new MessageReadEvent(this, visitor, msg));
+ }
replies.add(0, msg);
return ResponseEntity.ok(replies);
}