aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/TelegramBotManager.java
diff options
context:
space:
mode:
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()))