aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/controllers/SignUp.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/controllers/SignUp.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/SignUp.java12
1 files changed, 10 insertions, 2 deletions
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();
}
}