aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/MessengerManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-11 13:14:40 +0300
committerGravatar Vitaly Takmazov2018-05-11 13:14:40 +0300
commit6f85b661374ea0f3320dcff966fa7d76762ce742 (patch)
treec5d4757e8e82ba708211b3edc3d21943ce762552 /juick-server/src/main/java/com/juick/server/MessengerManager.java
parent007f78c1712e0dc1402c85914e40e9752deaae73 (diff)
AnonymousUser.INSTANCE where possible
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/MessengerManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/MessengerManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/MessengerManager.java b/juick-server/src/main/java/com/juick/server/MessengerManager.java
index 303e08ce..8bfcafd0 100644
--- a/juick-server/src/main/java/com/juick/server/MessengerManager.java
+++ b/juick-server/src/main/java/com/juick/server/MessengerManager.java
@@ -15,6 +15,7 @@ import com.github.messenger4j.webhook.event.TextMessageEvent;
import com.juick.Message;
import com.juick.User;
import com.juick.server.component.MessageEvent;
+import com.juick.server.helpers.AnonymousUser;
import com.juick.service.MessagesService;
import com.juick.service.MessengerService;
import com.juick.service.SubscriptionService;
@@ -76,7 +77,7 @@ public class MessengerManager implements ApplicationListener<MessageEvent> {
final String senderId = event.senderId();
final Instant timestamp = event.timestamp();
- User user_from = userService.getUserByUID(messengerService.getUserId(senderId)).orElse(new User());
+ User user_from = userService.getUserByUID(messengerService.getUserId(senderId)).orElse(AnonymousUser.INSTANCE);
logger.info("Found juick user {}", user_from.getUid());
if (user_from.isAnonymous()) {
try {