Skip to content

Commit

Permalink
fixed #314
Browse files Browse the repository at this point in the history
  • Loading branch information
windka committed Jun 12, 2023
1 parent 079ca48 commit 2921bc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

# [15.1.2] - 2023-06-12
### fixed unauthorized calls in event node - [#314](https://github.com/windkh/node-red-contrib-telegrambot/issues/314)

# [15.1.1] - 2023-04-29
### fixed port conflict in webhook mode - [#303](https://github.com/windkh/node-red-contrib-telegrambot/issues/303)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-telegrambot",
"version": "15.1.1",
"version": "15.1.2",
"description": "Telegram bot nodes for Node-RED",
"dependencies": {
"bluebird": "^3.7.2",
Expand Down
4 changes: 3 additions & 1 deletion telegrambot/99-telegrambot.js
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,7 @@ module.exports = function (RED) {
let username;
let chatid;
let userid;
let isAnonymous = false;
if (botMsg.chat) {
//channel
username = botMsg.chat.username;
Expand All @@ -1714,9 +1715,10 @@ module.exports = function (RED) {
userid = botMsg.from.id;
} else {
// chatid can be null in case of polls, inline_queries,...
isAnonymous = true;
}

if (node.config.isAuthorized(node, chatid, userid, username)) {
if (isAnonymous || node.config.isAuthorized(node, chatid, userid, username)) {
let msg;
let messageDetails;
let messageId;
Expand Down

0 comments on commit 2921bc1

Please sign in to comment.