aboutsummaryrefslogtreecommitdiff
path: root/juick-server-core/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-core/src/main/java/com')
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java139
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java52
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/Auth.java39
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java51
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java46
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java39
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java89
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java46
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java60
-rw-r--r--juick-server-core/src/main/java/com/juick/server/util/HashUtils.java36
-rw-r--r--juick-server-core/src/main/java/com/juick/server/util/TagUtils.java42
-rw-r--r--juick-server-core/src/main/java/com/juick/service/CrosspostService.java78
-rw-r--r--juick-server-core/src/main/java/com/juick/service/EmailService.java33
-rw-r--r--juick-server-core/src/main/java/com/juick/service/ImagesService.java7
-rw-r--r--juick-server-core/src/main/java/com/juick/service/MessagesService.java108
-rw-r--r--juick-server-core/src/main/java/com/juick/service/MessengerService.java14
-rw-r--r--juick-server-core/src/main/java/com/juick/service/PMQueriesService.java45
-rw-r--r--juick-server-core/src/main/java/com/juick/service/PrivacyQueriesService.java34
-rw-r--r--juick-server-core/src/main/java/com/juick/service/PushQueriesService.java50
-rw-r--r--juick-server-core/src/main/java/com/juick/service/ShowQueriesService.java31
-rw-r--r--juick-server-core/src/main/java/com/juick/service/SubscriptionService.java55
-rw-r--r--juick-server-core/src/main/java/com/juick/service/TagService.java63
-rw-r--r--juick-server-core/src/main/java/com/juick/service/TelegramService.java41
-rw-r--r--juick-server-core/src/main/java/com/juick/service/UserService.java138
-rw-r--r--juick-server-core/src/main/java/com/juick/service/search/SearchService.java31
25 files changed, 0 insertions, 1367 deletions
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java b/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java
deleted file mode 100644
index 122bbe29..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import com.juick.User;
-
-/**
- * Created by aalexeev on 12/11/16.
- */
-public final class AnonymousUser extends User {
- public static final AnonymousUser INSTANCE = new AnonymousUser();
-
- private AnonymousUser() {
- super.setUid(getUid());
- super.setName(getName());
- super.setAvatar(getAvatar());
- super.setFullName(getFullName());
- super.setMessagesCount(getMessagesCount());
- super.setAuthHash(getAuthHash());
- super.setBanned(isBanned());
- super.setCredentials(getCredentials());
- super.setLang(getLang());
- }
-
- @Override
- public boolean equals(Object obj) {
- return obj == this || obj instanceof AnonymousUser;
- }
-
- @Override
- public int getUid() {
- return 0;
- }
-
- @Override
- public String getName() {
- return "Anonymous";
- }
-
- @Override
- public String getFullName() {
- return getName();
- }
-
- @Override
- public String getAuthHash() {
- return null;
- }
-
- @Override
- public Integer getUnreadCount() {
- return 0;
- }
-
- @Override
- public boolean isBanned() {
- return false;
- }
-
- @Override
- public Object getAvatar() {
- return null;
- }
-
- @Override
- public String getCredentials() {
- return null;
- }
-
- @Override
- public String getLang() {
- return "__";
- }
-
- @Override
- public int getMessagesCount() {
- return 0;
- }
-
- @Override
- public boolean isAnonymous() {
- return true;
- }
-
- @Override
- public void setUid(int uid) {
- }
-
- @Override
- public void setName(String name) {
- }
-
- @Override
- public void setFullName(String fullName) {
- }
-
- @Override
- public void setAuthHash(String authHash) {
- }
-
- @Override
- public void setUnreadCount(Integer count) {
- }
-
- @Override
- public void setBanned(boolean banned) {
- }
-
- @Override
- public void setAvatar(Object avatar) {
- }
-
- @Override
- public void setCredentials(String credentials) {
- }
-
- @Override
- public void setLang(String lang) {
- }
-
- @Override
- public void setMessagesCount(int messagesCount) {
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java b/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java
deleted file mode 100644
index 8f57b2a6..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-/**
- * Created by vt on 03/09/16.
- */
-public class ApplicationStatus {
- private boolean connected;
- private boolean crosspostEnabled;
-
- @Override
- public String toString() {
- return new ToStringBuilder(this)
- .append("connected", connected)
- .append("crosspostEnabled", crosspostEnabled)
- .toString();
- }
-
- public boolean isConnected() {
- return connected;
- }
-
- public void setConnected(boolean connected) {
- this.connected = connected;
- }
-
- public boolean isCrosspostEnabled() {
- return crosspostEnabled;
- }
-
- public void setCrosspostEnabled(boolean crosspostEnabled) {
- this.crosspostEnabled = crosspostEnabled;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java b/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java
deleted file mode 100644
index d01efadd..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 09/02/16.
- */
-public class Auth {
- private String account;
- private String authCode;
-
- public Auth(String account, String authCode) {
- this.account = account;
- this.authCode = authCode;
- }
-
- public String getAccount() {
- return account;
- }
-
- public String getAuthCode() {
- return authCode;
- }
-} \ No newline at end of file
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java b/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java
deleted file mode 100644
index 0e49a424..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 03/09/16.
- */
-public class NotifyOpts {
- private boolean repliesEnabled;
- private boolean subscriptionsEnabled;
- private boolean recommendationsEnabled;
-
- public boolean isRepliesEnabled() {
- return repliesEnabled;
- }
-
- public void setRepliesEnabled(boolean repliesEnabled) {
- this.repliesEnabled = repliesEnabled;
- }
-
- public boolean isSubscriptionsEnabled() {
- return subscriptionsEnabled;
- }
-
- public void setSubscriptionsEnabled(boolean subscriptionsEnabled) {
- this.subscriptionsEnabled = subscriptionsEnabled;
- }
-
- public boolean isRecommendationsEnabled() {
- return recommendationsEnabled;
- }
-
- public void setRecommendationsEnabled(boolean recommendationsEnabled) {
- this.recommendationsEnabled = recommendationsEnabled;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java b/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java
deleted file mode 100644
index 86281d4a..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 16/01/16.
- */
-public class PrivacyOpts {
- private int uid;
- private int privacy;
-
- public PrivacyOpts() {
-
- }
-
- public int getUid() {
- return uid;
- }
-
- public void setUid(int uid) {
- this.uid = uid;
- }
-
- public int getPrivacy() {
- return privacy;
- }
-
- public void setPrivacy(int privacy) {
- this.privacy = privacy;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java b/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java
deleted file mode 100644
index 6e446f98..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.juick.User;
-
-import java.util.List;
-
-/**
- * Created by vt on 24/11/2016.
- */
-public class PrivateChats {
- private List<User> users;
-
- @JsonProperty("pms")
- public List<User> getUsers() {
- return users;
- }
-
- public void setUsers(List<User> users) {
- this.users = users;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java b/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java
deleted file mode 100644
index 91ba2b8a..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import java.util.Date;
-
-/**
- * Created by vitalyster on 13.12.2016.
- */
-public class ResponseReply {
- private String muname;
- private int mid;
- private int rid;
- private String uname;
- private String description;
- private Date pubDate;
- private String attachmentType;
-
- public String getMuname() {
- return muname;
- }
-
- public void setMuname(String muname) {
- this.muname = muname;
- }
-
- public int getMid() {
- return mid;
- }
-
- public void setMid(int mid) {
- this.mid = mid;
- }
-
- public int getRid() {
- return rid;
- }
-
- public void setRid(int rid) {
- this.rid = rid;
- }
-
- public String getUname() {
- return uname;
- }
-
- public void setUname(String uname) {
- this.uname = uname;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Date getPubDate() {
- return pubDate;
- }
-
- public void setPubDate(Date pubDate) {
- this.pubDate = pubDate;
- }
-
- public String getAttachmentType() {
- return attachmentType;
- }
-
- public void setAttachmentType(String attachmentType) {
- this.attachmentType = attachmentType;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java b/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java
deleted file mode 100644
index ab24983f..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.juick.Tag;
-
-/**
- * Created by vitalyster on 01.12.2016.
- */
-public class TagStats {
- private Tag tag;
- private int usageCount;
-
- public Tag getTag() {
- return tag;
- }
-
- public void setTag(Tag tag) {
- this.tag = tag;
- }
-
- @JsonProperty("messages")
- public int getUsageCount() {
- return usageCount;
- }
-
- public void setUsageCount(int usageCount) {
- this.usageCount = usageCount;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java b/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java
deleted file mode 100644
index 284cd2e8..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 03/09/16.
- */
-public class UserInfo {
- private String fullName;
- private String country;
- private String url;
- private String description;
-
- public String getFullName() {
- return fullName;
- }
-
- public void setFullName(String fullName) {
- this.fullName = fullName;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java b/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java
deleted file mode 100644
index b4500457..00000000
--- a/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.util;
-
-import java.util.Random;
-
-/**
- * Created by vitalyster on 29.06.2017.
- */
-public class HashUtils {
- private static final String ABCDEF = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- public static String generateHash(final int len) {
- Random rnd = new Random();
- StringBuilder sb = new StringBuilder(len);
- for (int i = 0; i < len; i++) {
- sb.append(ABCDEF.charAt(rnd.nextInt(ABCDEF.length())));
- }
- return sb.toString();
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java b/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java
deleted file mode 100644
index 9edeab32..00000000
--- a/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.util;
-
-import com.juick.Tag;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public class TagUtils {
- private TagUtils() {
- throw new IllegalStateException();
- }
-
- public static String toString(final List<Tag> tags) {
- if (CollectionUtils.isEmpty(tags))
- return StringUtils.EMPTY;
-
- return tags.stream().map(t -> " *" + t.getName())
- .collect(Collectors.joining());
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/CrosspostService.java b/juick-server-core/src/main/java/com/juick/service/CrosspostService.java
deleted file mode 100644
index b82621e5..00000000
--- a/juick-server-core/src/main/java/com/juick/service/CrosspostService.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.ExternalToken;
-import com.juick.server.helpers.ApplicationStatus;
-import org.apache.commons.lang3.tuple.Pair;
-
-import javax.annotation.Nonnull;
-import java.util.Optional;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface CrosspostService {
-
- Optional<ExternalToken> getTwitterToken(int uid);
-
- boolean deleteTwitterToken(Integer uid);
-
- Optional<Pair<String, String>> getFacebookTokens(int uid);
-
- ApplicationStatus getFbCrossPostStatus(int uid);
-
- boolean enableFBCrosspost(Integer uid);
-
- void disableFBCrosspost(Integer uid);
-
- @Nonnull
- String getTwitterName(int uid);
-
- String getTelegramName(int uid);
-
- Optional<Pair<String, String>> getVkTokens(int uid);
-
- void deleteVKUser(Integer uid);
-
- int getUIDbyFBID(long fbID);
-
- boolean createFacebookUser(long fbID, String loginhash, String token, String fbName, String fbLink);
-
- boolean updateFacebookUser(long fbID, String token, String fbName, String fbLink);
-
- int getUIDbyVKID(long vkID);
-
- boolean createVKUser(long vkID, String loginhash, String token, String vkName, String vkLink);
-
- String getFacebookNameByHash(String hash);
-
- String getTelegramNameByHash(String hash);
-
- boolean setFacebookUser(String hash, int uid);
-
- String getVKNameByHash(String hash);
-
- boolean setVKUser(String hash, int uid);
-
- boolean setTelegramUser(String hash, int uid);
-
- String getJIDByHash(String hash);
-
- boolean setJIDUser(String hash, int uid);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/EmailService.java b/juick-server-core/src/main/java/com/juick/service/EmailService.java
deleted file mode 100644
index 2440bcb4..00000000
--- a/juick-server-core/src/main/java/com/juick/service/EmailService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import java.util.List;
-
-/**
- * Created by vitalyster on 09.12.2016.
- */
-public interface EmailService {
- boolean verifyAddressByCode(Integer userId, String code);
- boolean addVerificationCode(Integer userId, String account, String code);
- boolean addEmail(Integer userId, String email);
- boolean deleteEmail(Integer userId, String account);
- String getNotificationsEmail(Integer userId);
- boolean setNotificationsEmail(Integer userId, String account);
- List<String> getEmails(Integer userId, boolean active);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/ImagesService.java b/juick-server-core/src/main/java/com/juick/service/ImagesService.java
deleted file mode 100644
index b5cff16e..00000000
--- a/juick-server-core/src/main/java/com/juick/service/ImagesService.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.juick.service;
-
-import com.juick.Message;
-
-public interface ImagesService {
- void setAttachmentMetadata(String imgDir, String baseUrl, Message msg) throws Exception;
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/MessagesService.java b/juick-server-core/src/main/java/com/juick/service/MessagesService.java
deleted file mode 100644
index 2a3e701e..00000000
--- a/juick-server-core/src/main/java/com/juick/service/MessagesService.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.User;
-import com.juick.server.helpers.ResponseReply;
-
-import java.time.LocalDateTime;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface MessagesService {
- int createMessage(int uid, String txt, String attachment, Collection<com.juick.Tag> tags);
-
- int createReply(int mid, int rid, int uid, String txt, String attachment);
-
- int getReplyIDIncrement(int mid);
-
- boolean recommendMessage(int mid, int vuid);
-
- boolean canViewThread(int mid, int uid);
-
- boolean isReadOnly(int mid);
-
- boolean isSubscribed(int uid, int mid);
-
- int getMessagePrivacy(int mid);
-
- com.juick.Message getMessage(int mid);
-
- com.juick.Message getReply(int mid, int rid);
-
- User getMessageAuthor(int mid);
-
- List<String> getMessageRecommendations(int mid);
-
- List<Integer> getAll(int visitorUid, int before);
-
- List<Integer> getTag(int tid, int visitorUid, int before, int cnt);
-
- List<Integer> getTags(String tids, int visitorUid, int before, int cnt);
-
- List<Integer> getPlace(int placeId, int visitorUid, int before);
-
- List<Integer> getMyFeed(int uid, int before, boolean recommended);
-
- List<Integer> getPrivate(int uid, int before);
-
- List<Integer> getDiscussions(int uid, Long to);
-
- List<Integer> getRecommended(int uid, int before);
-
- List<Integer> getPopular(int visitorUid, int before);
-
- List<Integer> getPhotos(int visitorUid, int before);
-
- List<Integer> getSearch(String search, int before);
-
- List<Integer> getUserBlog(int uid, int privacy, int before);
-
- List<Integer> getUserTag(int uid, int tid, int privacy, int before);
-
- List<Integer> getUserBlogAtDay(int uid, int privacy, int daysback);
-
- List<Integer> getUserBlogWithRecommendations(int uid, int privacy, int before);
-
- List<Integer> getUserRecommendations(int uid, int before);
-
- List<Integer> getUserPhotos(int uid, int privacy, int before);
-
- List<Integer> getUserSearch(int UID, String search, int privacy, int before);
-
- List<com.juick.Message> getMessages(List<Integer> mids);
-
- List<com.juick.Message> getReplies(int mid);
-
- boolean setMessagePopular(int mid, int popular);
-
- boolean setMessagePrivacy(int mid);
-
- boolean deleteMessage(int uid, int mid);
-
- boolean deleteReply(int uid, int mid, int rid);
-
- List<Integer> getLastMessages(int hours);
-
- List<ResponseReply> getLastReplies(int hours);
-
- List<Integer> getPopularCandidates();
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/MessengerService.java b/juick-server-core/src/main/java/com/juick/service/MessengerService.java
deleted file mode 100644
index e07c73fe..00000000
--- a/juick-server-core/src/main/java/com/juick/service/MessengerService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.juick.service;
-
-import com.juick.User;
-
-import java.util.Optional;
-
-public interface MessengerService {
- Integer getUserId(String senderId);
- Optional<String> getSenderId(User user);
- boolean createMessengerUser(String senderId, String displayName);
- String getDisplayName(String hash);
- String getSignUpHash(String senderId, String username);
- boolean linkMessengerUser(String hash, int uid);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/PMQueriesService.java b/juick-server-core/src/main/java/com/juick/service/PMQueriesService.java
deleted file mode 100644
index 4c70eece..00000000
--- a/juick-server-core/src/main/java/com/juick/service/PMQueriesService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.User;
-
-import java.util.List;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface PMQueriesService {
- boolean createPM(int uidFrom, int uid_to, String body);
-
- boolean addPMinRoster(int uid, String jid);
-
- boolean removePMinRoster(int uid, String jid);
-
- boolean havePMinRoster(int uid, String jid);
-
- String getLastView(int uidFrom, int uidTo);
-
- List<User> getPMLastConversationsUsers(int uid, int cnt);
-
- List<com.juick.Message> getPMMessages(int uid, int uidTo);
-
- List<com.juick.Message> getLastPMInbox(int uid);
-
- List<com.juick.Message> getLastPMSent(int uid);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/PrivacyQueriesService.java b/juick-server-core/src/main/java/com/juick/service/PrivacyQueriesService.java
deleted file mode 100644
index 17dd6a9b..00000000
--- a/juick-server-core/src/main/java/com/juick/service/PrivacyQueriesService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.Tag;
-import com.juick.User;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface PrivacyQueriesService {
- enum PrivacyResult {
- Removed, Added
- }
-
- PrivacyResult blacklistUser(User user, User target);
-
- PrivacyResult blacklistTag(User user, Tag tag);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/PushQueriesService.java b/juick-server-core/src/main/java/com/juick/service/PushQueriesService.java
deleted file mode 100644
index f84a83e4..00000000
--- a/juick-server-core/src/main/java/com/juick/service/PushQueriesService.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface PushQueriesService {
- List<String> getGCMRegID(int uid);
-
- List<String> getGCMTokens(Collection<Integer> uids);
-
- boolean addGCMToken(Integer uid, String token);
-
- boolean deleteGCMToken(String token);
-
- List<String> getMPNSURL(int uid);
-
- List<String> getMPNSTokens(Collection<Integer> uids);
-
- boolean addMPNSToken(Integer uid, String token);
-
- boolean deleteMPNSToken(String token);
-
- List<String> getAPNSToken(int uid);
-
- List<String> getAPNSTokens(Collection<Integer> uids);
-
- boolean addAPNSToken(Integer uid, String token);
-
- boolean deleteAPNSToken(String token);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/ShowQueriesService.java b/juick-server-core/src/main/java/com/juick/service/ShowQueriesService.java
deleted file mode 100644
index 32b34b4e..00000000
--- a/juick-server-core/src/main/java/com/juick/service/ShowQueriesService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.User;
-
-import java.util.List;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface ShowQueriesService {
- List<String> getRecommendedUsers(User forUser);
-
- List<String> getTopUsers();
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/SubscriptionService.java b/juick-server-core/src/main/java/com/juick/service/SubscriptionService.java
deleted file mode 100644
index 47f81415..00000000
--- a/juick-server-core/src/main/java/com/juick/service/SubscriptionService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.Tag;
-import com.juick.User;
-import com.juick.server.helpers.NotifyOpts;
-
-import java.util.List;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface SubscriptionService {
- List<String> getJIDSubscribedToUser(int uid, boolean friendsonly);
-
- List<User> getSubscribedUsers(int uid, int mid);
-
- List<User> getUsersSubscribedToComments(int mid, int ignore_uid);
-
- List<User> getUsersSubscribedToUserRecommendations(int uid, int mid, int muid);
-
- boolean subscribeMessage(int mid, int vuid);
-
- boolean unSubscribeMessage(int mid, int vuid);
-
- boolean subscribeUser(User user, User toUser);
-
- boolean unSubscribeUser(User user, User fromUser);
-
- boolean subscribeTag(User user, Tag toTag);
-
- boolean unSubscribeTag(User user, Tag toTag);
-
- List<String> getSubscribedTags(User user);
-
- NotifyOpts getNotifyOptions(User user);
-
- boolean setNotifyOptions(User user, NotifyOpts options);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/TagService.java b/juick-server-core/src/main/java/com/juick/service/TagService.java
deleted file mode 100644
index 7cd7768f..00000000
--- a/juick-server-core/src/main/java/com/juick/service/TagService.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.Tag;
-import com.juick.User;
-import com.juick.server.helpers.TagStats;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Stream;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface TagService {
- Tag getTag(int tid);
-
- Tag getTag(String tag, boolean autoCreate);
-
- List<Tag> getTags(Stream<String> tags, boolean autoCreate);
-
- boolean getTagNoIndex(int tagId);
-
- int createTag(String name);
-
- List<TagStats> getUserTagStats(int uid);
-
- List<String> getUserBLTags(int uid);
-
- List<String> getPopularTags();
-
- List<TagStats> getTagStats();
-
- List<Tag> updateTags(int mid, Collection<Tag> newTags);
-
- List<Tag> fromString(String txt, boolean tagsOnly);
-
- List<TagStats> getMessageTags(int mid);
-
- List<Integer> getMessageTagsIDs(int mid);
-
- boolean blacklistTag(User user, Tag tag);
-
- boolean isInBL(User user, Tag tag);
-
- boolean isSubscribed(User user, Tag tag);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/TelegramService.java b/juick-server-core/src/main/java/com/juick/service/TelegramService.java
deleted file mode 100644
index 7786ca9f..00000000
--- a/juick-server-core/src/main/java/com/juick/service/TelegramService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.User;
-
-import java.util.List;
-
-/**
- * Created by vt on 24/11/2016.
- */
-public interface TelegramService {
- boolean addChat(Long id);
-
- boolean deleteChat(Long id);
-
- List<Long> getChats();
-
- int getUser(long tgId);
-
- boolean createTelegramUser(long tgID, String tgName);
-
- boolean deleteTelegramUser(Integer uid);
-
- List<Long> getTelegramIdentifiers(List<User> users);
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/UserService.java b/juick-server-core/src/main/java/com/juick/service/UserService.java
deleted file mode 100644
index 115c7dfc..00000000
--- a/juick-server-core/src/main/java/com/juick/service/UserService.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service;
-
-import com.juick.User;
-import com.juick.server.helpers.Auth;
-import com.juick.server.helpers.UserInfo;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public interface UserService {
- enum ActiveStatus {
- Inactive,
- Active
- }
-
- String getSignUpHashByJID(String jid);
-
- String getSignUpHashByTelegramID(Long telegramId, String username);
-
- int createUser(String username, String password);
-
- Optional<User> getUserByUID(int uid);
-
- User getUserByName(String username);
-
- User getFullyUserByName(String username);
-
- User getUserByEmail(String email);
-
- List<User> getFullyUsersByNames(Collection<String> usernames);
-
- User getUserByJID(String jid);
-
- List<User> getUsersByName(Collection<String> unames);
-
- List<User> getUsersByID(Collection<Integer> uids);
-
- List<String> getJIDsbyUID(int uid);
-
- int getUIDbyJID(String jid);
-
- int getUIDbyName(String uname);
-
- int getUIDbyHash(String hash);
-
- com.juick.User getUserByHash(String hash);
-
- String getHashByUID(int uid);
-
- int getUIDByHttpAuth(String header);
-
- int checkPassword(String username, String password);
-
- boolean updatePassword(User user, String newPassword);
-
- int getUserOptionInt(int uid, String option, int defaultValue);
-
- int setUserOptionInt(int uid, String option, int value);
-
- UserInfo getUserInfo(User user);
-
- boolean updateUserInfo(User user, UserInfo info);
-
- boolean getCanMedia(int uid);
-
- boolean isInWL(int uid, int check);
-
- boolean isInBL(int uid, int check);
-
- boolean isInBLAny(int uid, int uid2);
-
- List<Integer> checkBL(int visitor, Collection<Integer> uids);
-
- boolean isSubscribed(int uid, int check);
-
- List<Integer> getUserRead(int uid);
-
- List<com.juick.User> getUserReadLeastPopular(int uid, int cnt);
-
- List<User> getUserReaders(int uid);
-
- List<User> getUserFriends(int uid);
-
- List<com.juick.User> getUserBLUsers(int uid);
-
- boolean linkTwitterAccount(User user, String accessToken, String accessTokenSecret, String screenName);
-
- int getStatsIRead(int uid);
-
- int getStatsMyReaders(int uid);
-
- int getStatsMessages(int uid);
-
- int getStatsReplies(int uid);
-
- boolean setActiveStatusForJID(String JID, ActiveStatus jidStatus);
-
- List<String> getAllJIDs(User user);
-
- List<Auth> getAuthCodes(User user);
-
- List<String> getEmails(User user);
-
- String getEmailHash(User user);
-
- int deleteLoginForUser(String name);
-
- int setLoginForUser(int uid, String loginHash);
-
- void logout(int uid);
-
- boolean deleteJID(int uid, String jid);
-
- boolean unauthJID(int uid, String jid);
-
- List<String> getActiveJIDs();
-}
diff --git a/juick-server-core/src/main/java/com/juick/service/search/SearchService.java b/juick-server-core/src/main/java/com/juick/service/search/SearchService.java
deleted file mode 100644
index b1ea9374..00000000
--- a/juick-server-core/src/main/java/com/juick/service/search/SearchService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.service.search;
-
-import java.util.List;
-
-/**
- * Created by aalexeev on 11/18/16.
- */
-public interface SearchService {
- void setMaxResult(int maxResult);
-
- List<Integer> searchInAllMessages(String searchString, int messageIdBefore);
-
- List<Integer> searchByStringAndUser(String searchString, final int userId, int messageIdBefore);
-}