Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
51353d1
Revert "[CP Staging] Revert "feat: allow users to change room avatar""
samranahm Oct 13, 2025
7a4a421
fix: prevent anonymous (not logged-in) users from editing room avatar
samranahm Oct 13, 2025
015993b
fix: default WorkspaceAvatar to use first letter instead of Workspace…
samranahm Oct 13, 2025
90a6bc1
fix: pass policyName to display correct default Workspace avatar in W…
samranahm Oct 13, 2025
d584102
Merge remote-tracking branch 'upstream/main' into revert-72436-revert…
samranahm Oct 20, 2025
eebb50f
Merge branch 'Expensify:main' into revert-72436-revert-66883-65210/ed…
samranahm Oct 23, 2025
67ee603
fix: change command name to UpdateRoomAvatar
samranahm Oct 23, 2025
08c697b
Merge branch 'Expensify:main' into revert-72436-revert-66883-65210/ed…
samranahm Oct 27, 2025
e5cf954
update can edit room avatar permissions
samranahm Oct 28, 2025
be630fd
lint
samranahm Oct 28, 2025
864cde7
Merge branch 'main' into revert-72436-revert-66883-65210/edit-room-av…
samranahm Oct 29, 2025
4c5c737
fix merge conflict
samranahm Oct 29, 2025
25e40b1
feat: add room avatar updated log message in all locals
samranahm Oct 30, 2025
9167f5e
add getRoomAvatarUpdatedMessage util to get the message accordingly
samranahm Oct 30, 2025
4fc58be
build optimistic room avatar updated report action
samranahm Oct 30, 2025
82325e8
use getRoomAvatarUpdatedMessage to get alternate text and last messag…
samranahm Oct 30, 2025
24a56d4
update canEditRoomAvatar to check current user in participants
samranahm Oct 30, 2025
332d571
clear pending action from failure data
samranahm Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,7 @@ const CONST = {
REMOVE_FROM_ROOM: 'REMOVEFROMROOM',
LEAVE_ROOM: 'LEAVEROOM',
UPDATE_ROOM_DESCRIPTION: 'UPDATEROOMDESCRIPTION',
UPDATE_ROOM_AVATAR: 'UPDATEROOMAVATAR',
},
REJECTEDTRANSACTION_THREAD: 'REJECTEDTRANSACTION_THREAD',
REJECTED_TRANSACTION_MARKASRESOLVED: 'REJECTEDTRANSACTIONMARKASRESOLVED',
Expand Down
5 changes: 5 additions & 0 deletions src/components/AvatarButtonWithIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ type AvatarButtonWithIconProps = {

/** Optionally override the default "Edit" icon */
editIcon?: IconAsset;

/** The name associated with avatar */
name?: string;
Comment on lines +65 to +66

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eh2077 When we upload the avatar offline and refresh the page we get workspace default icon and that default icon should be workspace name's first letter but it's fallBack workspace building icon. So we are passing workspace name to get correct workspace icon.

};

/**
Expand All @@ -82,6 +85,7 @@ function AvatarButtonWithIcon({
disabled = false,
editIcon = Expensicons.Pencil,
anchorRef,
name = '',
}: AvatarButtonWithIconProps) {
const theme = useTheme();
const styles = useThemeStyles();
Expand Down Expand Up @@ -110,6 +114,7 @@ function AvatarButtonWithIcon({
fallbackIcon={fallbackIcon}
size={size}
type={type}
name={name}
/>
) : (
<DefaultAvatar />
Expand Down
5 changes: 5 additions & 0 deletions src/components/AvatarWithImagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ type AvatarWithImagePickerProps = Omit<AvatarButtonWithIconProps, 'text' | 'onPr

/** Allows to open an image without Attachment Picker. */
enablePreview?: boolean;

/** The name associated with avatar */
name?: string;
Comment thread
samranahm marked this conversation as resolved.
};

const anchorAlignment = {horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.CENTER, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP};
Expand Down Expand Up @@ -96,6 +99,7 @@ function AvatarWithImagePicker({
onViewPhotoPress,
enablePreview = false,
editIcon = Expensicons.Pencil,
name = '',
}: AvatarWithImagePickerProps) {
const styles = useThemeStyles();
const isFocused = useIsFocused();
Expand Down Expand Up @@ -263,6 +267,7 @@ function AvatarWithImagePicker({
type={type}
disabledStyle={disabledStyle}
editIconStyle={editIconStyle}
name={name}
/>
</OfflineWithFeedback>
<PopoverMenu
Expand Down
41 changes: 38 additions & 3 deletions src/components/RoomHeaderAvatars.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
import React, {memo} from 'react';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import {clearAvatarErrors, getCurrentUserAccountID, updatePolicyRoomAvatar} from '@libs/actions/Report';
import Navigation from '@libs/Navigation/Navigation';
import {isUserCreatedPolicyRoom} from '@libs/ReportUtils';
import {isDefaultAvatar} from '@libs/UserUtils';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type {Policy, Report} from '@src/types/onyx';
import type {Icon} from '@src/types/onyx/OnyxCommon';
import Avatar from './Avatar';
import AvatarWithImagePicker from './AvatarWithImagePicker';
import * as Expensicons from './Icon/Expensicons';
import PressableWithoutFocus from './Pressable/PressableWithoutFocus';
import Text from './Text';

type RoomHeaderAvatarsProps = {
icons: Icon[];
reportID: string;
report: Report;
policy: OnyxEntry<Policy>;
participants: number[];
};

function RoomHeaderAvatars({icons, reportID}: RoomHeaderAvatarsProps) {
function RoomHeaderAvatars({icons, report, policy, participants}: RoomHeaderAvatarsProps) {
const navigateToAvatarPage = (icon: Icon) => {
if (icon.type === CONST.ICON_TYPE_WORKSPACE && icon.id) {
Navigation.navigate(ROUTES.REPORT_AVATAR.getRoute(reportID, icon.id.toString()));
Navigation.navigate(ROUTES.REPORT_AVATAR.getRoute(report?.reportID, icon.id.toString()));
return;
}

Expand All @@ -30,6 +38,8 @@ function RoomHeaderAvatars({icons, reportID}: RoomHeaderAvatarsProps) {

const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const currentUserAccountID = getCurrentUserAccountID();
const canEditRoomAvatar = isUserCreatedPolicyRoom(report) && participants.includes(currentUserAccountID) && !!policy && policy.role !== CONST.POLICY.ROLE.AUDITOR;

if (!icons.length) {
return null;
Expand All @@ -42,6 +52,31 @@ function RoomHeaderAvatars({icons, reportID}: RoomHeaderAvatarsProps) {
return;
}

if (canEditRoomAvatar) {
return (
<AvatarWithImagePicker
source={icon.source || report.avatarUrl}
avatarID={icon.id}
isUsingDefaultAvatar={!report.avatarUrl || isDefaultAvatar(icon.source)}
size={CONST.AVATAR_SIZE.X_LARGE}
avatarStyle={[styles.avatarXLarge, styles.alignSelfCenter]}
onViewPhotoPress={() => Navigation.navigate(ROUTES.REPORT_AVATAR.getRoute(report.reportID))}
onImageRemoved={() => updatePolicyRoomAvatar(report.reportID)}
onImageSelected={(file) => updatePolicyRoomAvatar(report.reportID, file)}
editIcon={Expensicons.Camera}
editIconStyle={styles.smallEditIconAccount}
pendingAction={report.pendingFields?.avatar}
errors={report.errorFields?.avatar ?? null}
errorRowStyles={styles.mt6}
onErrorClose={() => clearAvatarErrors(report.reportID)}
style={[styles.w100, styles.mb3, styles.alignItemsStart, styles.sectionMenuItemTopDescription]}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding styles.sectionMenuItemTopDescription caused this alignment issue: #76647. That style seemed unnecessary so we have remove that in this PR: #77394

More details in this proposal: #76647 (comment)

type={icon.type}
editorMaskImage={Expensicons.ImageCropSquareMask}
name={icon.name}
/>
);
}

return (
<PressableWithoutFocus
style={styles.noOutline}
Expand Down
2 changes: 2 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7145,6 +7145,8 @@ ${amount} für ${merchant} - ${date}`,
roomChangeLog: {
updateRoomDescription: 'setze die Raumbeschreibung auf:',
clearRoomDescription: 'Raumbeschreibung gelöscht',
changedRoomAvatar: 'Hat das Raum-Avatar geändert',
removedRoomAvatar: 'Hat das Raum-Avatar entfernt',
},
delegate: {
switchAccount: 'Konten wechseln:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7094,6 +7094,8 @@ const translations = {
roomChangeLog: {
updateRoomDescription: 'set the room description to:',
clearRoomDescription: 'cleared the room description',
changedRoomAvatar: 'changed the room avatar',
removedRoomAvatar: 'removed the room avatar',
},
delegate: {
switchAccount: 'Switch accounts:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7589,6 +7589,8 @@ ${amount} para ${merchant} - ${date}`,
roomChangeLog: {
updateRoomDescription: 'establece la descripción de la sala a:',
clearRoomDescription: 'la descripción de la habitación ha sido borrada',
changedRoomAvatar: 'Cambió el avatar de la sala',
removedRoomAvatar: 'Eliminó el avatar de la sala',
},
delegate: {
switchAccount: 'Cambiar de cuenta:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7148,6 +7148,8 @@ ${amount} pour ${merchant} - ${date}`,
roomChangeLog: {
updateRoomDescription: 'définir la description de la salle sur :',
clearRoomDescription: 'effacé la description de la salle',
changedRoomAvatar: 'A changé l’avatar de la salle',
removedRoomAvatar: 'A supprimé l’avatar de la salle',
},
delegate: {
switchAccount: 'Changer de compte :',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7153,6 +7153,8 @@ ${amount} per ${merchant} - ${date}`,
roomChangeLog: {
updateRoomDescription: 'imposta la descrizione della stanza su:',
clearRoomDescription: 'cancellato la descrizione della stanza',
changedRoomAvatar: "Ha cambiato l'avatar della stanza",
removedRoomAvatar: "Ha rimosso l'avatar della stanza",
},
delegate: {
switchAccount: 'Cambia account:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7082,6 +7082,8 @@ ${date} - ${merchant}に${amount}`,
roomChangeLog: {
updateRoomDescription: '部屋の説明を次のように設定します:',
clearRoomDescription: '部屋の説明をクリアしました',
changedRoomAvatar: 'ルームのアバターを変更しました',
removedRoomAvatar: 'ルームのアバターを削除しました',
},
delegate: {
switchAccount: 'アカウントを切り替える:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7135,6 +7135,8 @@ ${amount} voor ${merchant} - ${date}`,
roomChangeLog: {
updateRoomDescription: 'stel de kamerbeschrijving in op:',
clearRoomDescription: 'de kamerbeschrijving gewist',
changedRoomAvatar: 'De avatar van de kamer is gewijzigd',
removedRoomAvatar: 'De avatar van de kamer is verwijderd',
},
delegate: {
switchAccount: 'Accounts wisselen:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7123,6 +7123,8 @@ ${amount} dla ${merchant} - ${date}`,
roomChangeLog: {
updateRoomDescription: 'ustaw opis pokoju na:',
clearRoomDescription: 'wyczyszczono opis pokoju',
changedRoomAvatar: 'Zmieniono awatar pokoju',
removedRoomAvatar: 'Usunięto awatar pokoju',
},
delegate: {
switchAccount: 'Przełącz konta:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7130,6 +7130,8 @@ ${amount} para ${merchant} - ${date}`,
roomChangeLog: {
updateRoomDescription: 'defina a descrição da sala para:',
clearRoomDescription: 'limpou a descrição da sala',
changedRoomAvatar: 'Alterou o avatar da sala',
removedRoomAvatar: 'Removeu o avatar da sala',
},
delegate: {
switchAccount: 'Alternar contas:',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6985,6 +6985,8 @@ ${merchant}的${amount} - ${date}`,
roomChangeLog: {
updateRoomDescription: '将房间描述设置为:',
clearRoomDescription: '清除了房间描述',
changedRoomAvatar: '更改了房间头像',
removedRoomAvatar: '移除了房间头像',
},
delegate: {
switchAccount: '切换账户:',
Expand Down
9 changes: 9 additions & 0 deletions src/libs/API/parameters/UpdateRoomAvatarParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types';

type UpdateRoomAvatarParams = {
reportID: string;
file: File | CustomRNImageManipulatorResult | undefined;
reportActionID: string;
};

export default UpdateRoomAvatarParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export type {default as UpdateStatusParams} from './UpdateStatusParams';
export type {default as UpdateThemeParams} from './UpdateThemeParams';
export type {default as UpdateUserAvatarParams} from './UpdateUserAvatarParams';
export type {default as UpdateGroupChatAvatarParams} from './UpdateGroupChatAvatarParams';
export type {default as UpdateRoomAvatarParams} from './UpdateRoomAvatarParams';
export type {default as ValidateBankAccountWithTransactionsParams} from './ValidateBankAccountWithTransactionsParams';
export type {default as ValidateLoginParams} from './ValidateLoginParams';
export type {default as ValidateSecondaryLoginParams} from './ValidateSecondaryLoginParams';
Expand Down
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const WRITE_COMMANDS = {
UPDATE_SELECTED_TIMEZONE: 'UpdateSelectedTimezone',
UPDATE_USER_AVATAR: 'UpdateUserAvatar',
UPDATE_GROUP_CHAT_AVATAR: 'UpdateGroupChatAvatar',
UPDATE_ROOM_AVATAR: 'UpdateRoomAvatar',
DELETE_USER_AVATAR: 'DeleteUserAvatar',
REFER_TEACHERS_UNITE_VOLUNTEER: 'ReferTeachersUniteVolunteer',
ADD_SCHOOL_PRINCIPAL: 'AddSchoolPrincipal',
Expand Down Expand Up @@ -632,6 +633,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.INVITE_TO_ROOM]: Parameters.InviteToRoomParams;
[WRITE_COMMANDS.INVITE_TO_GROUP_CHAT]: Parameters.InviteToGroupChatParams;
[WRITE_COMMANDS.UPDATE_GROUP_CHAT_AVATAR]: Parameters.UpdateGroupChatAvatarParams;
[WRITE_COMMANDS.UPDATE_ROOM_AVATAR]: Parameters.UpdateRoomAvatarParams;
[WRITE_COMMANDS.PUSHER_PING]: Parameters.PusherPingParams;
[WRITE_COMMANDS.LEAVE_GROUP_CHAT]: Parameters.LeaveGroupChatParams;
[WRITE_COMMANDS.REMOVE_FROM_GROUP_CHAT]: Parameters.RemoveFromGroupChatParams;
Expand Down
3 changes: 3 additions & 0 deletions src/libs/OptionsListUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
getReportActionHtml,
getReportActionMessageText,
getRetractedMessage,
getRoomAvatarUpdatedMessage,
getRoomChangeLogMessage,
getSortedReportActions,
getTravelUpdateMessage,
Expand Down Expand Up @@ -188,7 +189,7 @@
*/
let currentUserLogin: string | undefined;
let currentUserAccountID: number | undefined;
Onyx.connect({

Check warning on line 192 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
currentUserLogin = value?.email;
Expand All @@ -197,19 +198,19 @@
});

let loginList: OnyxEntry<Login>;
Onyx.connect({

Check warning on line 201 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.LOGIN_LIST,
callback: (value) => (loginList = isEmptyObject(value) ? {} : value),
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
Onyx.connect({

Check warning on line 207 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => (allPersonalDetails = isEmptyObject(value) ? {} : value),
});

const policies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 213 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
callback: (policy, key) => {
if (!policy || !key || !policy.name) {
Expand All @@ -221,14 +222,14 @@
});

let allPolicies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 225 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (val) => (allPolicies = val),
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 232 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -237,7 +238,7 @@
});

let allReportNameValuePairs: OnyxCollection<ReportNameValuePairs>;
Onyx.connect({

Check warning on line 241 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -249,7 +250,7 @@
const allSortedReportActions: Record<string, ReportAction[]> = {};
let allReportActions: OnyxCollection<ReportActions>;
const lastVisibleReportActions: ReportActions = {};
Onyx.connect({

Check warning on line 253 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -311,13 +312,13 @@
});

let activePolicyID: OnyxEntry<string>;
Onyx.connect({

Check warning on line 315 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ACTIVE_POLICY_ID,
callback: (value) => (activePolicyID = value),
});

let nvpDismissedProductTraining: OnyxEntry<DismissedProductTraining>;
Onyx.connect({

Check warning on line 321 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING,
callback: (value) => (nvpDismissedProductTraining = value),
});
Expand Down Expand Up @@ -764,6 +765,8 @@
lastMessageTextFromReport = translateLocal('violations.resolvedDuplicates');
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION)) {
lastMessageTextFromReport = getUpdateRoomDescriptionMessage(lastReportAction);
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_AVATAR)) {
lastMessageTextFromReport = getRoomAvatarUpdatedMessage(lastReportAction);
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.RETRACTED)) {
lastMessageTextFromReport = getRetractedMessage();
} else if (isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.REOPENED)) {
Expand Down
17 changes: 17 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,11 @@ function getReportActionMessageFragments(action: ReportAction): Message[] {
return [{text: message, html: `<muted-text>${message}</muted-text>`, type: 'COMMENT'}];
}

if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_AVATAR)) {
const message = getRoomAvatarUpdatedMessage(action);
return [{text: message, html: `<muted-text>${message}</muted-text>`, type: 'COMMENT'}];
}

if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DESCRIPTION)) {
const message = getWorkspaceDescriptionUpdatedMessage(action);
return [{text: message, html: `<muted-text>${message}</muted-text>`, type: 'COMMENT'}];
Expand Down Expand Up @@ -2262,6 +2267,17 @@ function getUpdateRoomDescriptionMessage(reportAction: ReportAction): string {
return translateLocal('roomChangeLog.clearRoomDescription');
}

function getRoomAvatarUpdatedMessage(reportAction: ReportAction): string {
const originalMessage = getOriginalMessage(reportAction) as OriginalMessageChangeLog;
if (originalMessage?.avatarURL) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return translateLocal('roomChangeLog.changedRoomAvatar');
}

// eslint-disable-next-line @typescript-eslint/no-deprecated
return translateLocal('roomChangeLog.removedRoomAvatar');
}

function getRetractedMessage(): string {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return translateLocal('iou.retracted');
Expand Down Expand Up @@ -3406,6 +3422,7 @@ export {
getExportIntegrationLastMessageText,
getExportIntegrationMessageHTML,
getUpdateRoomDescriptionMessage,
getRoomAvatarUpdatedMessage,
didMessageMentionCurrentUser,
getPolicyChangeLogAddEmployeeMessage,
getPolicyChangeLogUpdateEmployee,
Expand Down
Loading
Loading