Skip to content

Commit

Permalink
refactor: export OtrSystemMessagesValues
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Dec 24, 2024
1 parent b31e7f9 commit e159072
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions apps/meteor/server/models/raw/Messages.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { OtrSystemMessagesValues } from '@rocket.chat/core-typings';
import type {
ILivechatDepartment,
IMessage,
Expand Down Expand Up @@ -30,7 +31,6 @@ import type {
} from 'mongodb';

import { BaseRaw } from './BaseRaw';
import { otrSystemMessages } from '../../../app/otr/lib/constants';
import { readSecondaryPreferred } from '../../database/readSecondaryPreferred';

type DeepWritable<T> = T extends (...args: any) => any
Expand Down Expand Up @@ -699,12 +699,7 @@ export class MessagesRaw extends BaseRaw<IMessage> implements IMessagesModel {
const query: Filter<IMessage> = {
rid: roomId,
t: {
$in: [
'otr',
otrSystemMessages.USER_JOINED_OTR,
otrSystemMessages.USER_REQUESTED_OTR_KEY_REFRESH,
otrSystemMessages.USER_KEY_REFRESHED_SUCCESSFULLY,
],
$in: ['otr', ...OtrSystemMessagesValues],
},
ts: { $lte: ts },
};
Expand Down
2 changes: 1 addition & 1 deletion packages/core-typings/src/IMessage/IMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const LivechatMessageTypesValues = [

const OtrMessageTypeValues = ['otr', 'otr-ack'] as const;

const OtrSystemMessagesValues = ['user_joined_otr', 'user_requested_otr_key_refresh', 'user_key_refreshed_successfully'] as const;
export const OtrSystemMessagesValues = ['user_joined_otr', 'user_requested_otr_key_refresh', 'user_key_refreshed_successfully'] as const;
export type OtrSystemMessages = (typeof OtrSystemMessagesValues)[number];

const MessageTypes = [
Expand Down

0 comments on commit e159072

Please sign in to comment.