-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
fix quick replies from notifications #4250
Conversation
@@ -412,7 +412,7 @@ private static PendingIntent getStatusReplyIntent(Context context, Notification | |||
.putExtra(KEY_SENDER_ACCOUNT_ID, account.getId()) | |||
.putExtra(KEY_SENDER_ACCOUNT_IDENTIFIER, account.getIdentifier()) | |||
.putExtra(KEY_SENDER_ACCOUNT_FULL_NAME, account.getFullName()) | |||
.putExtra(KEY_NOTIFICATION_ID, notificationId) | |||
.putExtra(KEY_NOTIFICATION_ID, body.getId()) |
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.
so this is mastodon notification id right? Should we rename KEY_NOTIFICATION_ID
to SERVER_NOTIFICATON_ID
or something? super confusing.
also notificationId
is misleading but idk how to rename it better
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC) | ||
.setCategory(NotificationCompat.CATEGORY_SOCIAL) | ||
.setTimeoutAfter(5000) | ||
.build() |
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.
Should this maybe be extracted?
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.
I was thinking about it, it is similar to other places where we build notifications, but not enough to be easily extracted. I think its easier to read like it is.
While working on #4249 I noticed that quick replies also don't work as expected. The notification just stays in the sending state forever.
There are actually 2 problems:
NotificationFetcher
with the id of the Mastodon notification as tag and the current account id as id. The wrong notification id was forwarded toSendStatusBroadcastReceiver
so it never had a chance of updating the notification.I also tried replacing the original notification with the "sending" notification of
SendStatusService
, but that doesn't work becauseService.startForeground
doesn't have a tag parameter, only an id.