-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
3591 detect push changes #3642
base: develop
Are you sure you want to change the base?
3591 detect push changes #3642
Conversation
32203c5
to
85b0095
Compare
85b0095
to
f81cc0c
Compare
@@ -554,6 +554,9 @@ class NotificationsFragment : | |||
} | |||
|
|||
private fun showFilterDialog() { | |||
// TODO why do we have two different "notification filter" settings; the ones here (only for ui) and the | |||
// ones in the account settings (NotificationPreferencesFragment)? |
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.
NotificationPreferencesFragment
is for older versions of Android that don't provide per-notification group settings (API versions <= 25).
You can see this in AccountPreferencesFragment.openNotificationSystemPrefs()
.
Unfortunately the term "filter" is overloaded and depends on context. In one context it's filtering the types of Android notifications you will receive.
In the other context it's filtering the types of notifications that are displayed in the notifications timeline.
This allows you to, e.g,. disable Android notifications for new followers, but still see the new follower notifications in the Notifications timeline.
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.
ok, removed the comment
isUnifiedPushAvailable() && !anyAccountNeedsMigration() | ||
|
||
fun hasPushNotificationsEnabled(account: AccountEntity): Boolean = | ||
isUnifiedPushAvailable() && !account.unifiedDistributorName.isNullOrEmpty() |
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.
isUnifiedPushAvailable() && !account.unifiedDistributorName.isNullOrEmpty() | |
isUnifiedPushAvailable() && account.unifiedDistributorName.isNotBlank() |
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.
unifiedDistributorName is nullable
if (shouldEnable) { | ||
enableUnifiedPushNotificationsForAccount(it) | ||
} else { | ||
disableUnifiedPushNotificationsForAccount(it) | ||
} |
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.
Why is a method called enablePushNotifications
possibly disabling push notifications?
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.
(it's moved old code)
Could be called doYourStuff
or manage
instead - as it is in PushNotificationManager
.
Maybe enableOrDisablePerAccount
?
Can you describe those separately to the code? E.g., a high level architecture sketch that describes what you think this should do? That's helpful for several reasons:
|
f81cc0c
to
1fd5c4a
Compare
There is no larger architecture here, yet. Maybe not needed (and there was none). It's basically "do push notification registration if needed on start". Most questions make sense at their specific location. Extracting them would loose valuable information. Thus they can and should be discussed in-line here. Most of them are in The biggest there on the top: Should we join pull and push notification code more? |
Maybe one general question still: The linked issue has be closed (by author). So it probably makes sense to add another one "improve push notifications" and change the references here (?) |
2c1fa12
to
580edd8
Compare
Updating / rebasing this another time. As people's main problem with Tusky is missing notifications. |
580edd8
to
733fc87
Compare
Probably fixes #3591, but is a huge step forward regardless.
Draft because the TODO count is still too high: Architecture decisions, feature decisions or at least "this is fine for now" decisions.
This improves the following for push notifications (ordered by importance):
Maybe main problem with also this code: All of this is (still) very edge-casey. For example there are a number of different paths and intentions in which the various methods of the new PushNotificationManager can be called.
It is rather involved testing this and it is still not possible for the user to "change anything" if something is wrong.
And: if there are few people using this the effort in programming here is also a problem.