mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.2k stars 1.33k forks source link

Android notifications shows profile picture of webhook creator instead of custom webhook picture #5681

Closed redfast00 closed 1 year ago

redfast00 commented 3 years ago

Summary

Android notifications shows profile picture of webhook creator instead of custom webhook picture

Environment Information

Steps to reproduce

  1. Create an incoming webhook with account A
  2. In the webhook, go to "Profile Picture", and paste a URL of an image there
  3. Send a message with that webhook to a channel user B is in
  4. Look at the Android notifications of user B

Expected behavior

I expect the image in the notification user B gets from the webhook to be the custom image (as it is on desktop or when you open the app).

Observed behavior (that appears unintentional)

It actually is the profile picture of the person who created the webhook (person A)

Possible fixes

This line doesn't check for "override_icon_url". https://github.com/mattermost/mattermost-mobile/blob/c784086595bd1a43f3ab686efa6f1bae88ca92f6/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotificationHelper.java#L83

Please also check if the username is set correctly when choosing "Override username" (I think the behaviour might be similar)

Since this issue is in the native part of the code, it might also be present on iOS.

enahum commented 3 years ago

Great catch @redfast00 iOS does not have this issue as it does not display the user profile image.

Now that you identified the issue, would you be able to submit a PR to include override_icon? The potential problem that I see here is to follow the server config that is not available native side to check for the EnableIconOverride setting.

The sender name on the other hand should be already solved as it should be included in the payload if I'm not mistaken

redfast00 commented 3 years ago

No, with the new academic year starting, I unfortunately don't have the time to get worked into the codebase

amyblais commented 3 years ago

Ticket: https://mattermost.atlassian.net/browse/MM-38660.

amyblais commented 1 year ago

This is fixed in Mattermost Mobile V2 Beta. Please see more details here on how to sign up as a beta tester: https://mattermost.com/blog/mobile-beta-program-v2/.