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/app/apps/server/bridges/uiInteraction.ts

25 lines
936 B

import { UiInteractionBridge as UiIntBridge } from '@rocket.chat/apps-engine/server/bridges/UiInteractionBridge';
import { IUIKitInteraction } from '@rocket.chat/apps-engine/definition/uikit';
import { IUser } from '@rocket.chat/apps-engine/definition/users';
import { Notifications } from '../../../notifications/server';
import { AppServerOrchestrator } from '../orchestrator';
export class UiInteractionBridge extends UiIntBridge {
// eslint-disable-next-line no-empty-function
constructor(private readonly orch: AppServerOrchestrator) {
super();
}
protected async notifyUser(user: IUser, interaction: IUIKitInteraction, appId: string): Promise<void> {
this.orch.debugLog(`The App ${appId} is sending an interaction to user.`);
const app = this.orch.getManager()?.getOneById(appId);
if (!app) {
throw new Error('Invalid app provided');
}
Notifications.notifyUser(user.id, 'uiInteraction', interaction);
}
}