aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Users.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Users.java b/juick-server/src/main/java/com/juick/server/api/Users.java
index 4e447d04..a7ea7ea0 100644
--- a/juick-server/src/main/java/com/juick/server/api/Users.java
+++ b/juick-server/src/main/java/com/juick/server/api/Users.java
@@ -20,6 +20,7 @@ package com.juick.server.api;
import com.juick.User;
import com.juick.server.util.HttpForbiddenException;
import com.juick.server.util.HttpNotFoundException;
+import com.juick.service.MessagesService;
import com.juick.service.UserService;
import com.juick.server.util.UserUtils;
import com.juick.server.util.WebUtils;
@@ -39,6 +40,8 @@ import java.util.List;
public class Users {
@Inject
private UserService userService;
+ @Inject
+ private MessagesService messagesService;
@ApiOperation(value = "This returns user token", notes = "Pass login and password using HTTP Basic")
@RequestMapping(value = "/auth", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@@ -74,6 +77,7 @@ public class Users {
me.setUid(visitor.getUid());
me.setName(visitor.getName());
me.setAuthHash(getAuthToken());
+ me.setUnreadCount(messagesService.getUnread(visitor).size());
return me;
}