diff options
author | Vitaly Takmazov | 2019-09-24 11:54:21 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-09-24 11:54:21 +0300 |
commit | 2f2e9aab6194037259625200091949d8648e3409 (patch) | |
tree | 4669e3bf5389bf68581094ab01dee4155a91e24f /src/main/java/com/juick/server/api/Messages.java | |
parent | 289afd5a0b510e4501cf421dd9a05bb53bc424c3 (diff) |
Use single event model for all application events
Diffstat (limited to 'src/main/java/com/juick/server/api/Messages.java')
-rw-r--r-- | src/main/java/com/juick/server/api/Messages.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/server/api/Messages.java b/src/main/java/com/juick/server/api/Messages.java index 3ac272f2..1c9e37ad 100644 --- a/src/main/java/com/juick/server/api/Messages.java +++ b/src/main/java/com/juick/server/api/Messages.java @@ -22,12 +22,12 @@ import com.juick.Tag; import com.juick.User; import com.juick.server.Utils; import com.juick.server.www.WebApp; -import com.juick.service.component.MessageReadEvent; import com.juick.model.CommandResult; import com.juick.server.util.HttpBadRequestException; import com.juick.service.MessagesService; import com.juick.service.TagService; import com.juick.service.UserService; +import com.juick.service.component.SystemEvent; import com.juick.service.security.annotation.Visitor; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.tuple.Pair; @@ -192,7 +192,7 @@ public class Messages { if (!visitor.isAnonymous()) { userService.updateLastSeen(visitor); applicationEventPublisher.publishEvent( - new MessageReadEvent(this, visitor, msg)); + new SystemEvent(this, SystemActivity.read(visitor, msg))); } replies.add(0, msg); return ResponseEntity.ok(replies); @@ -209,7 +209,7 @@ public class Messages { Message msg = messagesService.getMessage(mid).orElseThrow(IllegalStateException::new); userService.updateLastSeen(visitor); applicationEventPublisher.publishEvent( - new MessageReadEvent(this, visitor, msg)); + new SystemEvent(this, SystemActivity.read(visitor, msg))); return IOUtils.toByteArray(invisiblePixel.getInputStream()); } throw new HttpBadRequestException(); |