aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/MessengerManager.java
diff options
context:
space:
mode:
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 {