diff options
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components/service')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java b/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java index eecddc70..0f62e702 100644 --- a/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java +++ b/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java @@ -1,6 +1,7 @@ package com.juick.components.service; import com.fasterxml.jackson.databind.ObjectMapper; +import com.juick.components.Notifications; import com.juick.server.component.DisconnectedEvent; import com.juick.server.component.MessageEvent; import org.slf4j.Logger; @@ -26,6 +27,8 @@ public class JuickServerComponent extends TextWebSocketHandler { @Inject private ApplicationEventPublisher applicationEventPublisher; @Inject + private Notifications notifications; + @Inject private ObjectMapper jsonMapper; private WebSocketSession session; @@ -54,7 +57,7 @@ public class JuickServerComponent extends TextWebSocketHandler { if (logger.isInfoEnabled()) // prevent writeValueAsString execution if logger disabled logger.info("got jmsg: {}", jsonMapper.writeValueAsString(jmsg)); if (!closeFlag.get()) { - applicationEventPublisher.publishEvent(new MessageEvent(this, jmsg)); + notifications.messageReceived(jmsg); } } |