The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/app/utils/client/getRoomAvatarURL.ts

17 lines
577 B

import type { IRoom } from '@rocket.chat/core-typings';
import { getAvatarURL } from './getAvatarURL';
import { settings } from '../../settings/client';
export const getRoomAvatarURL = ({ roomId, cache = '' }: { roomId: IRoom['_id']; cache: IRoom['avatarETag'] }) => {
const externalSource = (settings.get('Accounts_RoomAvatarExternalProviderUrl') || '').trim().replace(/\/$/, '');
if (externalSource && typeof externalSource === 'string') {
return externalSource.replace('{roomId}', roomId);
}
if (!roomId) {
return;
}
return getAvatarURL({ roomId, cache });
};