diff --git a/app/core/src/main/java/stirling/software/SPDF/service/telegram/TelegramPipelineBot.java b/app/core/src/main/java/stirling/software/SPDF/service/telegram/TelegramPipelineBot.java index d5030bbce..94b5500a7 100644 --- a/app/core/src/main/java/stirling/software/SPDF/service/telegram/TelegramPipelineBot.java +++ b/app/core/src/main/java/stirling/software/SPDF/service/telegram/TelegramPipelineBot.java @@ -151,7 +151,7 @@ public class TelegramPipelineBot extends TelegramLongPollingBot { + " channel id={}", chat.getId()); } - if (from == null || !allowUserIDs.contains(from.getId().longValue())) { + if (from == null || !allowUserIDs.contains(from.getId())) { log.info( "Ignoring message {} from channel id={} due to user access" + " restrictions", @@ -172,23 +172,6 @@ public class TelegramPipelineBot extends TelegramLongPollingBot { // private chats } } - boolean userAllowed = - !telegramProperties.getEnableAllowUserIDs() - || (from != null && allowUserIDs.contains(from.getId())); - boolean channelAllowed = - !telegramProperties.getEnableAllowChannelIDs() - || allowChannelIDs.contains(chat.getId()); - if (!userAllowed && !channelAllowed) { - log.info( - "Ignoring message {} from user id={} in chat id={} due to access restrictions", - message.getMessageId(), - from != null ? from.getId() : "unknown", - chat.getId()); - sendMessage( - chat.getId(), - "You are not authorized to use this bot. Please contact the administrator."); - return; - } } if (from != null) { log.info(