aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/XMPPConnection.java
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-server/src/main/java/com/juick/server/XMPPConnection.java
parent78bc4cd5b9383320e989183942ba9ca11252a917 (diff)
using User::isAnonymous where possible
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/XMPPConnection.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPConnection.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
index 2c21a973..d15db3f2 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
@@ -159,7 +159,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
return iq.createResult(vCard);
}
User user = userService.getUserByName(iq.getTo().getLocal());
- if (user.getUid() > 0) {
+ if (!user.isAnonymous()) {
UserInfo info = userService.getUserInfo(user);
VCard userVCard = new VCard();
userVCard.setFormattedName(info.getFullName());
@@ -546,7 +546,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
Jid to = msg.getTo();
if (to.getDomain().equals(router.getDomain().toEscapedString()) || to.equals(this.jid)) {
User user_from = userService.getUserByJID(msg.getFrom().asBareJid().toEscapedString());
- if ((user_from == null || user_from.getUid() == 0) && !msg.getFrom().equals(jid)) {
+ if ((user_from == null || user_from.isAnonymous()) && !msg.getFrom().equals(jid)) {
String signuphash = userService.getSignUpHashByJID(msg.getFrom().asBareJid().toEscapedString());
return makeReply(msg.getFrom(), "Для того, чтобы начать пользоваться сервисом, пожалуйста пройдите быструю регистрацию: http://juick.com/signup?type=xmpp&hash=" + signuphash + "\nЕсли у вас уже есть учетная запись на Juick, вы сможете присоединить этот JabberID к ней.\n\nTo start using Juick, please sign up: http://juick.com/signup?type=xmpp&hash=" + signuphash + "\nIf you already have an account on Juick, you will be proposed to attach this JabberID to your existing account.");
}