-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[telegram] allow access restrictions on chat ids #7857
Conversation
Signed-off-by: Jan N. Klug <[email protected]>
...ab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. One remark.
chatIds.add(Long.valueOf(chatIdStr)); | ||
if (chatIdStr.trim().startsWith("<")) { | ||
// inbound only | ||
authorizedSenderChatId.add(Long.valueOf(chatIdStr.substring(1))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you trim()
earlier it is not a good idea to use substring(1)
on the not trimmed String. Maybe introduced a local variable for the `trimmedChatId and use it here and in the following lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.Done.
Signed-off-by: Jan N. Klug <[email protected]>
Travis tests were successfulHey @J-N-K, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
* allow access restrictions on chat ids Signed-off-by: Jan N. Klug <[email protected]> Signed-off-by: CSchlipp <[email protected]>
* allow access restrictions on chat ids Signed-off-by: Jan N. Klug <[email protected]>
* allow access restrictions on chat ids Signed-off-by: Jan N. Klug <[email protected]>
* allow access restrictions on chat ids Signed-off-by: Jan N. Klug <[email protected]>
* allow access restrictions on chat ids Signed-off-by: Jan N. Klug <[email protected]>
* allow access restrictions on chat ids Signed-off-by: Jan N. Klug <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
* allow access restrictions on chat ids Signed-off-by: Jan N. Klug <[email protected]>
Adds the ability to use access modifiers on chat is. Use-case: Some chat ids (e.g. children) should receive notifications but should not be allowed to send commands.
Fully backward compatible, no modifier = sending and receiving
Signed-off-by: Jan N. Klug [email protected]