Closed doits closed 1 year ago
I just realized the priority strings could be shortened now so it doesn't look so messy (still tdb for all languages):
I just pushed some commits (probably should be squashed before it is merged, but we are not there yet):
NotificationDispatcher
to NotificationService
, so the logic is not spread over two classesNotificationService
scope
, so that a channel id is created by a scope
and priority
– better than name
+ priority
?Hopefully this makes the code more understandable.
Points not addressed yet:
displayName
for the group but always name it server.sh/topic
(lazy solution) are add logic to change the group's name when the display name of a subscription changesThat's all from me for now. Feel free to review it again, I hope the code got better!
Looks very very very nice.
I'm going to take the PR from here. It's fantastic work. Thank you @doits! Are you on Discord/Matrix? If not, you should join :-D
PR superseded by https://github.com/binwiederhier/ntfy-android/pull/49
I gave a shot to implement first part of https://github.com/binwiederhier/ntfy/issues/6#issuecomment-1332280747.
For sure there are issues in this code, please don't be too hard with your review since this is my first time hacking on a kotlin project :-). I mostly did everything by copying existing code and by try and error. It isn't much battle tested either.
It allows to toggle a checkbox for each notification called "Own notification channels" in detail settings:
If toggled, it creates an own notification channel group with notification channels for each priority:
Notifications get sent to the correct group priority channel.
Default notifications (e.g. if the subscription does not use own notification channels) are grouped under a new "Default" group:
That's it.
This way you can set custom notification sounds, override dnd etc. per subscription.
Feel free to give your thoughts if this is something you want to have in your app or you think more of a different way to solve issue https://github.com/binwiederhier/ntfy/issues/6.