RocketChat/Rocket.Chat

View on GitHub
apps/meteor/app/statistics/server/functions/otrStats.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Rooms } from '@rocket.chat/models';

import telemetryEvent from '../lib/telemetryEvents';
import { updateCounter } from './updateStatsCounter';

type otrDataType = { rid: string };

export async function otrStats(data: otrDataType) {
    updateCounter({ settingsId: 'OTR_Count' });

    await Rooms.setOTRForDMByRoomID(data.rid);
}

telemetryEvent.register('otrStats', otrStats);