aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/TelegramBotManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-10-21 22:52:14 +0300
committerGravatar Vitaly Takmazov2021-10-21 22:52:14 +0300
commitc6972c05dcee19afb5725767f755a56f5162aee2 (patch)
tree64b8f3588e97d8e1141fc17646e99a11f57abe46 /src/main/java/com/juick/TelegramBotManager.java
parentcfb6c1894d8223eac62d03eeececa7baf192aced (diff)
Make popular feed equal to service user recommendations feed to have correct RSS feeds
Diffstat (limited to 'src/main/java/com/juick/TelegramBotManager.java')
-rw-r--r--src/main/java/com/juick/TelegramBotManager.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/juick/TelegramBotManager.java b/src/main/java/com/juick/TelegramBotManager.java
index 3538a27b..33cac896 100644
--- a/src/main/java/com/juick/TelegramBotManager.java
+++ b/src/main/java/com/juick/TelegramBotManager.java
@@ -93,8 +93,8 @@ public class TelegramBotManager implements NotificationListener {
private ApplicationEventPublisher applicationEventPublisher;
@Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}")
private String tmpDir;
- @Value("${service_user:juick}")
- private String serviceUser;
+ @Inject
+ private User serviceUser;
private static final String MSG_LINK = "🔗";
@@ -397,7 +397,7 @@ public class TelegramBotManager implements NotificationListener {
if (type.equals(SystemActivity.ActivityType.message)) {
processMessage(activity.getMessage(), activity.getTo());
} else if (type.equals(SystemActivity.ActivityType.like)) {
- if (systemEvent.getActivity().getFrom().getName().equals(serviceUser)) {
+ if (systemEvent.getActivity().getFrom().equals(serviceUser)) {
processTop(systemEvent.getActivity().getMessage());
} else {
processLike(activity.getFrom(), activity.getMessage(), activity.getTo());
@@ -433,7 +433,7 @@ public class TelegramBotManager implements NotificationListener {
}
private void processLike(User liker, com.juick.model.Message message, List<User> subscribers) {
- if (!liker.getName().equals(serviceUser)) {
+ if (!liker.equals(serviceUser)) {
logger.info("Like received in tg listener");
if (!userService.isInBLAny(message.getUser().getUid(), liker.getUid())) {
telegramService.getTelegramIdentifiers(Collections.singletonList(message.getUser()))