From 485600a958c13707e9a1d4940e254f449ecab8ca Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 30 May 2018 10:37:29 +0300 Subject: api: do not publish read events from anonymous --- juick-server/src/main/java/com/juick/server/api/Messages.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-server/src/main/java/com/juick') 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 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); } -- cgit v1.2.3