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/api/server/helpers/isWidget.ts

8 lines
302 B

import { parse } from 'cookie';
export const isWidget = (headers: Record<string, any> = {}): boolean => {
const { rc_room_type: roomType, rc_is_widget: isWidget } = parse(headers.cookie || '');
const isLivechatRoom = roomType && roomType === 'l';
return !!(isLivechatRoom && isWidget === 't');
};