aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-10 15:04:57 +0300
committerGravatar Vitaly Takmazov2018-05-10 15:04:57 +0300
commitb642c55f053583533e23b1fc7fc5ac318fcbd7f0 (patch)
tree3255d68fe48ee38aeba6de4359c631f9b9ddf70f /juick-common/src
parent78bc4cd5b9383320e989183942ba9ca11252a917 (diff)
using User::isAnonymous where possible
Diffstat (limited to 'juick-common/src')
-rw-r--r--juick-common/src/main/java/com/juick/server/CommandsManager.java4
-rw-r--r--juick-common/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/juick-common/src/main/java/com/juick/server/CommandsManager.java b/juick-common/src/main/java/com/juick/server/CommandsManager.java
index 918e6028..d3be371f 100644
--- a/juick-common/src/main/java/com/juick/server/CommandsManager.java
+++ b/juick-common/src/main/java/com/juick/server/CommandsManager.java
@@ -145,7 +145,7 @@ public class CommandsManager {
User user_to = userService.getUserByName(arguments[0]);
- if (user_to.getUid() > 0) {
+ if (!user_to.isAnonymous()) {
if (!userService.isInBLAny(user_to.getUid(), user_from.getUid())) {
if (pmQueriesService.createPM(user_from.getUid(), user_to.getUid(), body)) {
com.juick.Message jmsg = new com.juick.Message();
@@ -379,7 +379,7 @@ public class CommandsManager {
public CommandResult commandUser(User user, URI attachment, String... arguments) {
User blogUser = userService.getUserByName(arguments[0]);
int page = arguments[1].length();
- if (blogUser.getUid() > 0) {
+ if (!blogUser.isAnonymous()) {
List<Integer> mids = messagesService.getUserBlog(blogUser.getUid(), 0, 0);
return CommandResult.fromString(String.format("Last messages from @%s:\n%s", arguments[0],
printMessages(mids, false)));
diff --git a/juick-common/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java b/juick-common/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java
index 04794d07..3a1d129d 100644
--- a/juick-common/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java
+++ b/juick-common/src/main/java/com/juick/service/security/deprecated/RequestParamHashRememberMeServices.java
@@ -80,7 +80,7 @@ public class RequestParamHashRememberMeServices extends AbstractRememberMeServic
if (StringUtils.isNotBlank(hash)) {
User user = userService.getUserByHash(hash);
- if (user.getUid() > 0)
+ if (!user.isAnonymous())
return new JuickUser(user);
}
throw new UsernameNotFoundException("User not found by hash " + hash);