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/client/startup/streamMessage/googlevision.ts

24 lines
740 B

import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { callbacks } from '../../../app/callbacks/client';
import { settings } from '../../../app/settings/client';
Meteor.startup(() => {
Tracker.autorun(() => {
const isEnabled = settings.get('GoogleVision_Enable');
if (!isEnabled) {
callbacks.remove('streamMessage', 'googlevision');
return;
}
import('../../../app/google-vision/client').then(
({ createGoogleVisionMessageStreamHandler }) => {
const streamMessage = createGoogleVisionMessageStreamHandler();
callbacks.remove('streamMessage', 'googlevision');
callbacks.add('streamMessage', streamMessage, callbacks.priority.HIGH - 3, 'googlevision');
},
);
});
});