Telegram-FOSS-Team / Telegram-FOSS

Unofficial, FOSS-friendly fork of the original Telegram client for Android
GNU General Public License v2.0
2.94k stars 376 forks source link

[BUG] NotificationPermissionDialog accidental dismiss logic is backwards #752

Closed NinTheNoodle closed 3 months ago

NinTheNoodle commented 3 months ago

The logic here is backwards and is causing the application to repeatedly ask me to enable notifications.

This current logic is saying to repeat the notification later only if the user did not accidentally dismiss the notification. The notification is also not repeated if they dismissed it within 300 milliseconds of it showing up. I suspect this it is intended to be the other way around.

306bobby-android commented 3 months ago

It looks like the logic is correct, but if the press is under 3 seconds it is considered accidental.

Wait 3 seconds, then decline notifications.

753 moves it to 1 second

NinTheNoodle commented 3 months ago

Thank you for the change. That should help. I must have read it wrong.

The phrasing of if (!mayBeAccidentalDismiss) { askLater(); } reads to me as "if the dismissal is not potentially accidental, ask again later", which seemed backwards to me.

I have not downloaded a development build, so I if it works then it works. Thanks.