Michal-Szczepaniak / Yottagram

14 stars 10 forks source link

Suppress notification for multiple messages from the same sender or group #11

Open 24mu13 opened 4 years ago

24mu13 commented 4 years ago

I have some (annoying) friend sending multiple/separate messages in sequence, like the following:

hey
how are you?
still sick?

In this case I will receive THREE notifications (sound), disturbing and useless. Not to mention the same scenario in a chat-group, where everybody is texting at the same time! Nightmare.

In all these scenarios, I would like to receive a single notification when additional message is coming for same contact/group within a configurable time-slice (when zero means this feature is off).

An idea is to use a kind for Redis local cache where key is sender/group-id, and each key-value has an expiration depending of above setting.

https://github.com/tdlib/td/issues/930

Michal-Szczepaniak commented 4 years ago

Dont @ me, talk to telegram.

24mu13 commented 4 years ago

If you look at the linked issue, they say this should be handled by the consumer app.

Michal-Szczepaniak commented 4 years ago

I rethought about it, and yes my bad for not clicking link. Telegram desktop sends sound for every new message, but maybe i could do some rate limiting

levlam commented 4 years ago

Between, you don't need Redis for this. TDLib has the method setChatClientData and the field chat.client_data to store application-specific chat settings exactly like this one.

Michal-Szczepaniak commented 4 years ago

Using Redis just to limit simple for loop would be bigest overkill in history, same with client data