[MM-44954] Regenerate default avatar (#22871)

* Regenerate default profile picture if username has changed

- Only actions is profile picture has not been changed
- Adjusts ResetLastPictureUpdate store function to store
-curTime instead of 0
    - This is to support updating the default picture while still
    retaining the ability to discern a default image from a set one.
- Changes SetDefaultProfileImage to leverage UpdateDefaultProfileImage
- Test updates around updating user default profile pictures

* App interface updates

* Only display picture update date if non-negative

- Ensures we don't display negative timestamps (default images)
- Change ported for mono-repo changes

* Remove duplicate test assertion

---------

Co-authored-by: Nathan Geist <ngeist@spiria.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Nathan
2023-05-04 08:14:26 -06:00
коммит произвёл GitHub
родитель 349e5d4573
Коммит 670b0e4c9f
8 изменённых файлов: 105 добавлений и 18 удалений

Просмотреть файл

@@ -1335,7 +1335,7 @@ export class UserSettingsGeneralTab extends React.Component<Props, State> {
if (Utils.isMobile()) {
minMessage = formatMessage(holders.uploadImageMobile);
}
if (user.last_picture_update) {
if (user.last_picture_update > 0) {
minMessage = (
<FormattedMessage
id='user.settings.general.imageUpdated'