aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www')
-rw-r--r--src/main/java/com/juick/www/api/ApiSocialLogin.java2
-rw-r--r--src/main/java/com/juick/www/api/Messages.java8
-rw-r--r--src/main/java/com/juick/www/api/Notifications.java2
-rw-r--r--src/main/java/com/juick/www/api/PM.java6
-rw-r--r--src/main/java/com/juick/www/api/Post.java12
-rw-r--r--src/main/java/com/juick/www/api/Service.java10
-rw-r--r--src/main/java/com/juick/www/api/Users.java8
-rw-r--r--src/main/java/com/juick/www/api/activity/Profile.java12
-rw-r--r--src/main/java/com/juick/www/api/webfinger/Resource.java2
-rw-r--r--src/main/java/com/juick/www/api/webhooks/TelegramWebhook.java2
-rw-r--r--src/main/java/com/juick/www/controllers/Help.java2
-rw-r--r--src/main/java/com/juick/www/controllers/Settings.java4
-rw-r--r--src/main/java/com/juick/www/controllers/SignUp.java4
-rw-r--r--src/main/java/com/juick/www/controllers/Site.java13
-rw-r--r--src/main/java/com/juick/www/controllers/SocialLogin.java10
-rw-r--r--src/main/java/com/juick/www/filters/AnythingFilter.java2
-rw-r--r--src/main/java/com/juick/www/rss/Feeds.java2
17 files changed, 50 insertions, 51 deletions
diff --git a/src/main/java/com/juick/www/api/ApiSocialLogin.java b/src/main/java/com/juick/www/api/ApiSocialLogin.java
index 6499b507..101f6b1f 100644
--- a/src/main/java/com/juick/www/api/ApiSocialLogin.java
+++ b/src/main/java/com/juick/www/api/ApiSocialLogin.java
@@ -34,7 +34,7 @@ import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.juick.model.AuthResponse;
import com.juick.model.ext.facebook.User;
-import com.juick.server.util.HttpBadRequestException;
+import com.juick.util.HttpBadRequestException;
import com.juick.service.CrosspostService;
import com.juick.service.EmailService;
import com.juick.service.UserService;
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java
index 59ed7c8f..de29c78c 100644
--- a/src/main/java/com/juick/www/api/Messages.java
+++ b/src/main/java/com/juick/www/api/Messages.java
@@ -20,10 +20,10 @@ package com.juick.www.api;
import com.juick.model.Message;
import com.juick.model.Tag;
import com.juick.model.User;
-import com.juick.server.Utils;
+import com.juick.util.WebUtils;
import com.juick.www.WebApp;
import com.juick.model.CommandResult;
-import com.juick.server.util.HttpBadRequestException;
+import com.juick.util.HttpBadRequestException;
import com.juick.service.MessagesService;
import com.juick.service.TagService;
import com.juick.service.UserService;
@@ -119,7 +119,7 @@ public class Messages {
} else if (daysback > 0) {
mids = messagesService.getUserBlogAtDay(user.getUid(), 0, daysback);
} else if (!StringUtils.isEmpty(search)) {
- mids = messagesService.getUserSearch(visitor, user.getUid(), Utils.encodeSphinx(search), 0, page);
+ mids = messagesService.getUserSearch(visitor, user.getUid(), WebUtils.encodeSphinx(search), 0, page);
} else {
mids = messagesService.getUserBlog(user.getUid(), 0, before);
}
@@ -139,7 +139,7 @@ public class Messages {
return NOT_FOUND;
}
} else if (!StringUtils.isEmpty(search)) {
- mids = messagesService.getSearch(visitor, Utils.encodeSphinx(search), page);
+ mids = messagesService.getSearch(visitor, WebUtils.encodeSphinx(search), page);
} else {
mids = messagesService.getAll(visitor.getUid(), before);
}
diff --git a/src/main/java/com/juick/www/api/Notifications.java b/src/main/java/com/juick/www/api/Notifications.java
index ca382246..4f6096ce 100644
--- a/src/main/java/com/juick/www/api/Notifications.java
+++ b/src/main/java/com/juick/www/api/Notifications.java
@@ -22,7 +22,7 @@ import com.juick.model.Message;
import com.juick.model.Status;
import com.juick.model.User;
import com.juick.model.AnonymousUser;
-import com.juick.server.util.HttpBadRequestException;
+import com.juick.util.HttpBadRequestException;
import com.juick.service.MessagesService;
import com.juick.service.PushQueriesService;
import com.juick.service.SubscriptionService;
diff --git a/src/main/java/com/juick/www/api/PM.java b/src/main/java/com/juick/www/api/PM.java
index b81dcc78..863a1055 100644
--- a/src/main/java/com/juick/www/api/PM.java
+++ b/src/main/java/com/juick/www/api/PM.java
@@ -22,9 +22,9 @@ import com.juick.model.Message;
import com.juick.model.User;
import com.juick.model.AnonymousUser;
import com.juick.model.PrivateChats;
-import com.juick.server.util.HttpBadRequestException;
-import com.juick.server.util.HttpForbiddenException;
-import com.juick.server.util.WebUtils;
+import com.juick.util.HttpBadRequestException;
+import com.juick.util.HttpForbiddenException;
+import com.juick.util.WebUtils;
import com.juick.www.WebApp;
import com.juick.service.PMQueriesService;
import com.juick.service.UserService;
diff --git a/src/main/java/com/juick/www/api/Post.java b/src/main/java/com/juick/www/api/Post.java
index 3c1fbf6b..205c8c90 100644
--- a/src/main/java/com/juick/www/api/Post.java
+++ b/src/main/java/com/juick/www/api/Post.java
@@ -22,12 +22,12 @@ import com.juick.model.Reaction;
import com.juick.model.Status;
import com.juick.model.User;
import com.juick.model.CommandResult;
-import com.juick.server.ActivityPubManager;
-import com.juick.server.CommandsManager;
-import com.juick.server.util.HttpBadRequestException;
-import com.juick.server.util.HttpForbiddenException;
-import com.juick.server.util.HttpNotFoundException;
-import com.juick.server.util.HttpUtils;
+import com.juick.ActivityPubManager;
+import com.juick.CommandsManager;
+import com.juick.util.HttpBadRequestException;
+import com.juick.util.HttpForbiddenException;
+import com.juick.util.HttpNotFoundException;
+import com.juick.util.HttpUtils;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
import com.juick.service.activities.UpdateEvent;
diff --git a/src/main/java/com/juick/www/api/Service.java b/src/main/java/com/juick/www/api/Service.java
index cb918682..850acb9d 100644
--- a/src/main/java/com/juick/www/api/Service.java
+++ b/src/main/java/com/juick/www/api/Service.java
@@ -20,11 +20,11 @@ package com.juick.www.api;
import com.juick.model.Message;
import com.juick.model.User;
import com.juick.model.CommandResult;
-import com.juick.server.CommandsManager;
-import com.juick.server.EmailManager;
-import com.juick.server.ServerManager;
-import com.juick.server.util.HttpBadRequestException;
-import com.juick.server.util.HttpForbiddenException;
+import com.juick.CommandsManager;
+import com.juick.EmailManager;
+import com.juick.ServerManager;
+import com.juick.util.HttpBadRequestException;
+import com.juick.util.HttpForbiddenException;
import com.juick.service.EmailService;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
diff --git a/src/main/java/com/juick/www/api/Users.java b/src/main/java/com/juick/www/api/Users.java
index 06467b7d..f4c3a4c1 100644
--- a/src/main/java/com/juick/www/api/Users.java
+++ b/src/main/java/com/juick/www/api/Users.java
@@ -20,10 +20,10 @@ package com.juick.www.api;
import com.juick.model.User;
import com.juick.model.AnonymousUser;
import com.juick.model.ApplicationStatus;
-import com.juick.server.util.HttpBadRequestException;
-import com.juick.server.util.HttpNotFoundException;
-import com.juick.server.util.HttpUtils;
-import com.juick.server.util.WebUtils;
+import com.juick.util.HttpBadRequestException;
+import com.juick.util.HttpNotFoundException;
+import com.juick.util.HttpUtils;
+import com.juick.util.WebUtils;
import com.juick.www.WebApp;
import com.juick.service.*;
import com.juick.service.component.MailVerificationEvent;
diff --git a/src/main/java/com/juick/www/api/activity/Profile.java b/src/main/java/com/juick/www/api/activity/Profile.java
index bdd7cab2..ef9b342f 100644
--- a/src/main/java/com/juick/www/api/activity/Profile.java
+++ b/src/main/java/com/juick/www/api/activity/Profile.java
@@ -20,12 +20,12 @@ package com.juick.www.api.activity;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.juick.model.Message;
import com.juick.model.User;
-import com.juick.formatters.PlainTextFormatter;
+import com.juick.util.formatters.PlainTextFormatter;
import com.juick.model.CommandResult;
-import com.juick.server.ActivityPubManager;
-import com.juick.server.CommandsManager;
-import com.juick.server.KeystoreManager;
-import com.juick.server.SignatureManager;
+import com.juick.ActivityPubManager;
+import com.juick.CommandsManager;
+import com.juick.KeystoreManager;
+import com.juick.SignatureManager;
import com.juick.www.api.activity.model.Activity;
import com.juick.www.api.activity.model.Context;
import com.juick.www.api.activity.model.activities.Announce;
@@ -40,7 +40,7 @@ import com.juick.www.api.activity.model.objects.Note;
import com.juick.www.api.activity.model.objects.OrderedCollection;
import com.juick.www.api.activity.model.objects.OrderedCollectionPage;
import com.juick.www.api.activity.model.objects.Person;
-import com.juick.server.util.HttpNotFoundException;
+import com.juick.util.HttpNotFoundException;
import com.juick.www.WebApp;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
diff --git a/src/main/java/com/juick/www/api/webfinger/Resource.java b/src/main/java/com/juick/www/api/webfinger/Resource.java
index 1529ea09..1e8b45e5 100644
--- a/src/main/java/com/juick/www/api/webfinger/Resource.java
+++ b/src/main/java/com/juick/www/api/webfinger/Resource.java
@@ -20,7 +20,7 @@ package com.juick.www.api.webfinger;
import com.juick.model.User;
import com.juick.www.api.webfinger.model.Account;
import com.juick.www.api.webfinger.model.Link;
-import com.juick.server.util.HttpNotFoundException;
+import com.juick.util.HttpNotFoundException;
import com.juick.service.UserService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
diff --git a/src/main/java/com/juick/www/api/webhooks/TelegramWebhook.java b/src/main/java/com/juick/www/api/webhooks/TelegramWebhook.java
index 32218b3a..8090f388 100644
--- a/src/main/java/com/juick/www/api/webhooks/TelegramWebhook.java
+++ b/src/main/java/com/juick/www/api/webhooks/TelegramWebhook.java
@@ -17,7 +17,7 @@
package com.juick.www.api.webhooks;
-import com.juick.server.TelegramBotManager;
+import com.juick.TelegramBotManager;
import com.pengrad.telegrambot.BotUtils;
import com.pengrad.telegrambot.model.Update;
import org.apache.commons.io.IOUtils;
diff --git a/src/main/java/com/juick/www/controllers/Help.java b/src/main/java/com/juick/www/controllers/Help.java
index 7fc84060..f65e254a 100644
--- a/src/main/java/com/juick/www/controllers/Help.java
+++ b/src/main/java/com/juick/www/controllers/Help.java
@@ -18,7 +18,7 @@
package com.juick.www.controllers;
import com.juick.model.User;
-import com.juick.server.util.HttpNotFoundException;
+import com.juick.util.HttpNotFoundException;
import com.juick.service.HelpService;
import com.juick.service.security.annotation.Visitor;
import com.juick.www.WebApp;
diff --git a/src/main/java/com/juick/www/controllers/Settings.java b/src/main/java/com/juick/www/controllers/Settings.java
index 851e576b..69ddcd2f 100644
--- a/src/main/java/com/juick/www/controllers/Settings.java
+++ b/src/main/java/com/juick/www/controllers/Settings.java
@@ -18,8 +18,8 @@ package com.juick.www.controllers;
import com.juick.model.User;
import com.juick.model.NotifyOpts;
-import com.juick.server.util.HttpBadRequestException;
-import com.juick.server.util.HttpUtils;
+import com.juick.util.HttpBadRequestException;
+import com.juick.util.HttpUtils;
import com.juick.www.WebApp;
import com.juick.service.*;
import com.juick.service.security.annotation.Visitor;
diff --git a/src/main/java/com/juick/www/controllers/SignUp.java b/src/main/java/com/juick/www/controllers/SignUp.java
index 4e74d4c4..3b052e18 100644
--- a/src/main/java/com/juick/www/controllers/SignUp.java
+++ b/src/main/java/com/juick/www/controllers/SignUp.java
@@ -17,8 +17,8 @@
package com.juick.www.controllers;
import com.juick.model.User;
-import com.juick.server.util.HttpBadRequestException;
-import com.juick.server.util.HttpForbiddenException;
+import com.juick.util.HttpBadRequestException;
+import com.juick.util.HttpForbiddenException;
import com.juick.www.WebApp;
import com.juick.service.CrosspostService;
import com.juick.service.EmailService;
diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java
index 61b84f71..a8cbc9bd 100644
--- a/src/main/java/com/juick/www/controllers/Site.java
+++ b/src/main/java/com/juick/www/controllers/Site.java
@@ -19,11 +19,10 @@ package com.juick.www.controllers;
import com.juick.model.Message;
import com.juick.model.Tag;
import com.juick.model.User;
-import com.juick.formatters.PlainTextFormatter;
-import com.juick.server.Utils;
-import com.juick.server.util.HttpForbiddenException;
-import com.juick.server.util.HttpNotFoundException;
-import com.juick.server.util.WebUtils;
+import com.juick.util.formatters.PlainTextFormatter;
+import com.juick.util.HttpForbiddenException;
+import com.juick.util.HttpNotFoundException;
+import com.juick.util.WebUtils;
import com.juick.www.WebApp;
import com.juick.service.*;
import com.juick.service.security.annotation.Visitor;
@@ -109,7 +108,7 @@ public class Site {
if (paramSearch != null) {
title = "Поиск: " + StringEscapeUtils.escapeHtml4(paramSearch);
- mids = messagesService.getSearch(visitor, Utils.encodeSphinx(paramSearch), page);
+ mids = messagesService.getSearch(visitor, WebUtils.encodeSphinx(paramSearch), page);
} else if (paramShow == null) {
title = "Обсуждения";
mids = messagesService.getDiscussions(visitor.getUid(), paramTo);
@@ -228,7 +227,7 @@ public class Site {
mids = messagesService.getUserTag(user.getUid(), paramTag.TID, privacy, before);
} else if (paramSearch != null) {
title = "Блог " + user.getName() + ": " + StringEscapeUtils.escapeHtml4(paramSearch);
- mids = messagesService.getUserSearch(visitor, user.getUid(), Utils.encodeSphinx(paramSearch), privacy, page);
+ mids = messagesService.getUserSearch(visitor, user.getUid(), WebUtils.encodeSphinx(paramSearch), privacy, page);
} else {
title = "Блог " + user.getName();
mids = messagesService.getUserBlog(user.getUid(), privacy, before);
diff --git a/src/main/java/com/juick/www/controllers/SocialLogin.java b/src/main/java/com/juick/www/controllers/SocialLogin.java
index 2bd89587..ffd785b7 100644
--- a/src/main/java/com/juick/www/controllers/SocialLogin.java
+++ b/src/main/java/com/juick/www/controllers/SocialLogin.java
@@ -24,13 +24,13 @@ import com.github.scribejava.core.oauth.OAuth10aService;
import com.github.scribejava.core.oauth.OAuth20Service;
import com.juick.model.ext.facebook.User;
import com.juick.model.ext.vk.UsersResponse;
-import com.juick.server.Utils;
-import com.juick.server.util.HttpBadRequestException;
+import com.juick.util.HttpBadRequestException;
import com.juick.service.CrosspostService;
import com.juick.service.EmailService;
import com.juick.service.TelegramService;
import com.juick.service.UserService;
import com.juick.service.security.annotation.Visitor;
+import com.juick.util.WebUtils;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.proc.BadJOSEException;
import org.apache.commons.codec.digest.DigestUtils;
@@ -140,7 +140,7 @@ public class SocialLogin {
if (StringUtils.isBlank(code)) {
String fbstate = UUID.randomUUID().toString();
if (StringUtils.isBlank(state)) {
- state = Utils.getPreviousPageByRequest(request).orElse("https://juick.com/");
+ state = WebUtils.getPreviousPageByRequest(request).orElse("https://juick.com/");
}
crosspostService.addFacebookState(fbstate, state);
return "redirect:" + facebookAuthService.getAuthorizationUrl(fbstate);
@@ -282,7 +282,7 @@ public class SocialLogin {
Cookie c = new Cookie("hash", userService.getHashByUID(uid));
c.setMaxAge(50 * 24 * 60 * 60);
response.addCookie(c);
- return "redirect:/" + Utils.getPreviousPageByRequest(request).orElse(StringUtils.EMPTY);
+ return "redirect:/" + WebUtils.getPreviousPageByRequest(request).orElse(StringUtils.EMPTY);
} else {
String loginhash = UUID.randomUUID().toString();
if (!crosspostService.createVKUser(vkID, loginhash, token.getAccessToken(), vkName, vkLink)) {
@@ -312,7 +312,7 @@ public class SocialLogin {
Cookie c = new Cookie("hash", userService.getHashByUID(uid));
c.setMaxAge(50 * 24 * 60 * 60);
response.addCookie(c);
- return "redirect:/" + Utils.getPreviousPageByRequest(request).orElse(StringUtils.EMPTY);
+ return "redirect:/" + WebUtils.getPreviousPageByRequest(request).orElse(StringUtils.EMPTY);
} else {
String username = StringUtils.defaultString(params.get("username"), params.get("first_name"));
List<Long> chats = telegramService.getAnonymous();
diff --git a/src/main/java/com/juick/www/filters/AnythingFilter.java b/src/main/java/com/juick/www/filters/AnythingFilter.java
index 8f9af7f6..461a2888 100644
--- a/src/main/java/com/juick/www/filters/AnythingFilter.java
+++ b/src/main/java/com/juick/www/filters/AnythingFilter.java
@@ -18,7 +18,7 @@
package com.juick.www.filters;
import com.juick.model.User;
-import com.juick.server.util.WebUtils;
+import com.juick.util.WebUtils;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
import org.apache.commons.lang3.math.NumberUtils;
diff --git a/src/main/java/com/juick/www/rss/Feeds.java b/src/main/java/com/juick/www/rss/Feeds.java
index 42cadc5d..1817301e 100644
--- a/src/main/java/com/juick/www/rss/Feeds.java
+++ b/src/main/java/com/juick/www/rss/Feeds.java
@@ -18,7 +18,7 @@
package com.juick.www.rss;
import com.juick.model.User;
-import com.juick.server.util.HttpNotFoundException;
+import com.juick.util.HttpNotFoundException;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
import com.juick.service.security.annotation.Visitor;