Delabs Show current avatar and name for users in message history (#8764)

Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
Šimon Brandner 2022-07-04 21:37:48 +02:00 committed by GitHub
parent 0bf5d54041
commit 88afd552d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 299 additions and 8 deletions

View file

@ -42,7 +42,7 @@ interface IProps extends Omit<React.ComponentProps<typeof BaseAvatar>, "name" |
pushUserOnClick?: boolean;
title?: string;
style?: any;
forceHistorical?: boolean; // true to deny `feature_use_only_current_profiles` usage. Default false.
forceHistorical?: boolean; // true to deny `useOnlyCurrentProfiles` usage. Default false.
hideTitle?: boolean;
}
@ -72,7 +72,7 @@ export default class MemberAvatar extends React.PureComponent<IProps, IState> {
private static getState(props: IProps): IState {
let member = props.member;
if (member && !props.forceHistorical && SettingsStore.getValue("feature_use_only_current_profiles")) {
if (member && !props.forceHistorical && SettingsStore.getValue("useOnlyCurrentProfiles")) {
const room = MatrixClientPeg.get().getRoom(member.roomId);
if (room) {
member = room.getMember(member.userId);

View file

@ -38,7 +38,7 @@ export default class SenderProfile extends React.PureComponent<IProps> {
const msgtype = mxEvent.getContent().msgtype;
let member = mxEvent.sender;
if (SettingsStore.getValue("feature_use_only_current_profiles")) {
if (SettingsStore.getValue("useOnlyCurrentProfiles")) {
const room = MatrixClientPeg.get().getRoom(mxEvent.getRoomId());
if (room) {
member = room.getMember(mxEvent.getSender());

View file

@ -89,6 +89,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
'Pill.shouldShowPillAvatar',
'TextualBody.enableBigEmoji',
'scrollToBottomOnMessageSent',
'useOnlyCurrentProfiles',
];
static GENERAL_SETTINGS = [
'promptBeforeInviteUnknownUsers',

View file

@ -347,10 +347,8 @@ export const SETTINGS: {[setting: string]: ISetting} = {
displayName: _td("Show extensible event representation of events"),
default: false,
},
"feature_use_only_current_profiles": {
isFeature: true,
labsGroup: LabGroup.Rooms,
supportedLevels: LEVELS_FEATURE,
"useOnlyCurrentProfiles": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Show current avatar and name for users in message history"),
default: false,
},