aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/NewMessage.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/SignUp.java12
2 files changed, 11 insertions, 3 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java
index d188dfbe..9e022557 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java
@@ -190,7 +190,7 @@ public class NewMessage {
sharetwi += " http://juick.com/" + mid;
model.addAttribute("sharetwi", sharetwi);
}
- if (!crosspostService.getFacebookToken(visitor.getUid()).isPresent()) {
+ if (!crosspostService.getFacebookTokens(visitor.getUid()).isPresent()) {
model.addAttribute("facebook", 1);
}
model.addAttribute("tags", tagService.getUserTagStats(visitor.getUid()).stream()
diff --git a/juick-www/src/main/java/com/juick/www/controllers/SignUp.java b/juick-www/src/main/java/com/juick/www/controllers/SignUp.java
index c8c64ef5..a5851215 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/SignUp.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/SignUp.java
@@ -20,6 +20,7 @@ import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.HttpForbiddenException;
import com.juick.server.util.UserUtils;
import com.juick.service.CrosspostService;
+import com.juick.service.MessengerService;
import com.juick.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
@@ -42,6 +43,8 @@ public class SignUp {
private UserService userService;
@Inject
private CrosspostService crosspostService;
+ @Inject
+ private MessengerService messengerService;
@GetMapping("/signup")
@@ -67,6 +70,9 @@ public class SignUp {
case "durov":
account = crosspostService.getTelegramNameByHash(hash);
break;
+ case "messenger":
+ account = messengerService.getDisplayName(hash);
+ break;
}
if (account == null) {
throw new HttpBadRequestException();
@@ -113,7 +119,8 @@ public class SignUp {
if (!(type.charAt(0) == 'f' && crosspostService.setFacebookUser(hash, uid))
&& !(type.charAt(0) == 'v' && crosspostService.setVKUser(hash, uid))
&& !(type.charAt(0) == 'd' && crosspostService.setTelegramUser(hash, uid))
- && !(type.charAt(0) == 'x' && crosspostService.setJIDUser(hash, uid))) {
+ && !(type.charAt(0) == 'x' && crosspostService.setJIDUser(hash, uid))
+ && !(type.charAt(0) == 'm' && messengerService.linkMessengerUser(hash, uid))) {
throw new HttpBadRequestException();
}
@@ -132,7 +139,8 @@ public class SignUp {
if (!(type.charAt(0) == 'f' && crosspostService.setFacebookUser(hash, uid))
&& !(type.charAt(0) == 'v' && crosspostService.setVKUser(hash, uid))
&& !(type.charAt(0) == 'd' && crosspostService.setTelegramUser(hash, uid))
- && !(type.charAt(0) == 'x' && crosspostService.setJIDUser(hash, uid))) {
+ && !(type.charAt(0) == 'x' && crosspostService.setJIDUser(hash, uid))
+ && !(type.charAt(0) == 'm' && messengerService.linkMessengerUser(hash, uid))) {
throw new HttpBadRequestException();
}
}