matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
181 stars 94 forks source link

Add API for getting the current notification counts. #215

Open erikjohnston opened 7 years ago

erikjohnston commented 7 years ago

As per https://github.com/matrix-org/synapse/pull/926 and https://matrix.to/#/!DdJkzRliezrwpNebLk:matrix.org/$14686556611517EDanG:kentshikama.com

So as part of a larger project I'm working on creating a simple javascript extension that reads notifications. Code looks as follows: https://github.com/aoh0x7DE/diaspora/blob/0d2a4973398be1cb8387fba444f6503cd7a8e2b4/app/assets/javascripts/matrix.js . Unfortunately it needs to poll every second to feel real time. If we remove the filter to try to make it only return if there is an event, it does indeed return the count for the specific room but not others. The thing is, if there are no events in a room, the request will return no events for that room, meaning that there will also be no unread_notifications count for that room because that magically disappears if there are no events.

@KentShikama

KentShikama commented 2 years ago

@erikjohnston Just a note that I ended up not pursuing the project further, so I no longer have a direct need for this feature.