fix(notifications): respect showContactPicture setting for notification avatars#10786
Conversation
|
Missing report label. Set exactly one of: |
rafaeltonholo
left a comment
There was a problem hiding this comment.
Hi @mvanhorn,
Thank you for taking the time to work on this PR.
While your current change allows users to enable or disable the Avatar in notifications, the configuration you're using is incorrect.
The MessageListPreferencesManager is meant for the Message List screen, not for Notifications. There may be instances where users prefer not to have Avatars displayed in notifications but still want to see them in the Message List, and vice versa.
To properly address issue #10750, we should add a new user preference under NotificationPreference. This would allow users to disable Avatars specifically for notifications.
For reference, you can look at commit 8dfa32e, which demonstrates how to add a new Boolean preference using the NotificationPreferenceManager.
Thank you!
3e12625 to
d847439
Compare
|
Thanks for the review, @rafaeltonholo. Reworked this in d847439 to use a dedicated Changes:
Force-pushed to replace the original commit since the underlying approach changed. |
rafaeltonholo
left a comment
There was a problem hiding this comment.
LGTM, please, just update your branch with the latest main version, so we can get rid of the CI failure.
Closes thunderbird#10750. Per @rafaeltonholo's review: MessageListPreferencesManager controls avatars on the message list, not in notifications. A user may want avatars in one place but not the other. Adds a new isShowContactPictureInNotification field on NotificationPreference, persists it via NotificationPreferenceManager, and reads it from SingleMessageNotificationCreator.setAvatar(). Adds a matching toggle in general settings. Defaults to true to preserve current behavior. Pattern mirrors commit 8dfa32e.
d847439 to
172694b
Compare
|
Thanks for the approval @rafaeltonholo. Rebased onto current main (172694b on top of fb1baad) and force-pushed. The diff is unchanged. The |
I've placed the label already; you should be good now. Once the CI finishes, we can merge these changes! Thanks for this contribution! |
|
Thanks for your contribution! Your pull request has been merged and will be part of Thunderbird 20. We appreciate the time and effort you put into improving Thunderbird. If you haven’t already, you’re welcome to join our Matrix chat for contributors. It’s where we discuss development and help each other out. https://matrix.to/#/#tb-android-dev:mozilla.org |
Summary
When contact pictures are disabled in the message list settings, notification avatars are still shown. This checks the
isShowContactPicturepreference before loading contact avatars for new mail notifications.Why this matters
PR #9652 added avatar support to notifications but didn't check the existing contact picture visibility setting. Users who disable contact pictures in the message list expect notifications to also respect that preference.
Changes
SingleMessageNotificationCreator.kt: AddedMessageListPreferencesManageras a constructor dependency and an early return insetAvatar()whenisShowContactPictureis false (line 68)CoreNotificationKoinModule.kt: InjectedmessageListPreferencesManagerintoSingleMessageNotificationCreatorTesting
showContactPicturekey used by the message list UI (MessageViewHolder.kt:63)isShowContactPictureis false,setAvatar()returns without loading or setting the large iconisShowContactPictureis true (default), behavior is unchangedFixes #10750
This contribution was developed with AI assistance (Claude Code).