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/federation/server/methods/testSetup.ts

29 lines
765 B

import { Meteor } from 'meteor/meteor';
import { eventTypes } from '@rocket.chat/core-typings';
import type { ServerMethods } from '@rocket.chat/ui-contexts';
import { getFederationDomain } from '../lib/getFederationDomain';
import { dispatchEvent } from '../handler';
declare module '@rocket.chat/ui-contexts' {
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ServerMethods {
FEDERATION_Test_Setup(): { message: string };
}
}
Meteor.methods<ServerMethods>({
FEDERATION_Test_Setup() {
try {
void dispatchEvent([getFederationDomain()], {
type: eventTypes.PING,
});
return {
message: 'FEDERATION_Test_Setup_Success',
};
} catch (err) {
throw new Meteor.Error('FEDERATION_Test_Setup_Error');
}
},
});