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/internal.js

27 lines
610 B

import { Subscriptions, Settings } from '../../../models';
export class AppInternalBridge {
constructor(orch) {
this.orch = orch;
}
getUsernamesOfRoomById(roomId) {
const records = Subscriptions.findByRoomIdWhenUsernameExists(roomId, {
fields: {
'u.username': 1,
},
}).fetch();
if (!records || records.length === 0) {
return [];
}
return records.map((s) => s.u.username);
}
getWorkspacePublicKey() {
const publicKeySetting = Settings.findById('Cloud_Workspace_PublicKey').fetch()[0];
return this.orch.getConverters().get('settings').convertToApp(publicKeySetting);
}
}