Show badges on message avatars where applicable

This commit is contained in:
Evan Hahn 2021-11-15 16:53:42 -06:00 committed by GitHub
parent fbd7292663
commit 7d17158add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 90 additions and 9 deletions

View file

@ -134,6 +134,8 @@ import type { LinkPreviewType } from '../types/message/LinkPreviews';
import * as log from '../logging/log';
import * as Bytes from '../Bytes';
import { computeHash } from '../Crypto';
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
import { getPreferredBadgeSelector } from '../state/selectors/badges';
/* eslint-disable camelcase */
/* eslint-disable more/no-then */
@ -392,6 +394,13 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
ourConversationId,
ourNumber: window.textsecure.storage.user.getNumber(),
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
preferredBadgeSelector: (
...args: Parameters<PreferredBadgeSelectorType>
) => {
const state = window.reduxStore.getState();
const preferredBadgeSelector = getPreferredBadgeSelector(state);
return preferredBadgeSelector(...args);
},
regionCode: window.storage.get('regionCode', 'ZZ'),
accountSelector: (identifier?: string) => {
const state = window.reduxStore.getState();