Skip to content

Commit 9505de9

Browse files
juliajforestiggazzo
authored andcommitted
chore!: remove OTR (#36691)
1 parent 5e2e69e commit 9505de9

File tree

132 files changed

+23
-2864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+23
-2864
lines changed

apps/meteor/app/api/server/v1/chat.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Message } from '@rocket.chat/core-services';
21
import type { IMessage, IThreadMainMessage } from '@rocket.chat/core-typings';
32
import { Messages, Users, Rooms, Subscriptions } from '@rocket.chat/models';
43
import {
@@ -21,7 +20,6 @@ import {
2120
isChatFollowMessageProps,
2221
isChatUnfollowMessageProps,
2322
isChatGetMentionedMessagesProps,
24-
isChatOTRProps,
2523
isChatReactProps,
2624
isChatGetDeletedMessagesProps,
2725
isChatSyncThreadsListProps,
@@ -41,7 +39,6 @@ import { messageSearch } from '../../../../server/methods/messageSearch';
4139
import { getMessageHistory } from '../../../../server/publications/messages';
4240
import { roomAccessAttributes } from '../../../authorization/server';
4341
import { canAccessRoomAsync, canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom';
44-
import { canSendMessageAsync } from '../../../authorization/server/functions/canSendMessage';
4542
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
4643
import { deleteMessageValidatingPermission } from '../../../lib/server/functions/deleteMessage';
4744
import { processWebhookMessage } from '../../../lib/server/functions/processWebhookMessage';
@@ -843,28 +840,6 @@ API.v1.addRoute(
843840
},
844841
);
845842

846-
API.v1.addRoute(
847-
'chat.otr',
848-
{ authRequired: true, validateParams: isChatOTRProps },
849-
{
850-
async post() {
851-
const { roomId, type: otrType } = this.bodyParams;
852-
853-
const { username, type } = this.user;
854-
855-
if (!username) {
856-
throw new Meteor.Error('error-invalid-user', 'Invalid user');
857-
}
858-
859-
await canSendMessageAsync(roomId, { uid: this.userId, username, type });
860-
861-
await Message.saveSystemMessage(otrType, roomId, username, { _id: this.userId, username });
862-
863-
return API.v1.success();
864-
},
865-
},
866-
);
867-
868843
API.v1.addRoute(
869844
'chat.getURLPreview',
870845
{ authRequired: true, validateParams: isChatGetURLPreviewProps },

apps/meteor/app/lib/server/functions/sendMessage.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Apps } from '@rocket.chat/apps';
2-
import { api, Message } from '@rocket.chat/core-services';
2+
import { Message } from '@rocket.chat/core-services';
33
import type { IMessage, IRoom } from '@rocket.chat/core-typings';
44
import { Messages } from '@rocket.chat/models';
55
import { Match, check } from 'meteor/check';
@@ -225,11 +225,6 @@ export const sendMessage = async function (user: any, message: any, room: any, u
225225
await validateMessage(message, room, user);
226226
prepareMessageObject(message, room._id, user);
227227

228-
if (message.t === 'otr') {
229-
void api.broadcast('otrMessage', { roomId: message.rid, message, user, room });
230-
return message;
231-
}
232-
233228
if (settings.get('Message_Read_Receipt_Enabled')) {
234229
message.unread = true;
235230
}

apps/meteor/app/lib/server/methods/sendMessage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ Meteor.methods<ServerMethods>({
131131
tshow: Match.Maybe(Boolean),
132132
ts: Match.Maybe(Date),
133133
t: Match.Maybe(String),
134-
otrAck: Match.Maybe(String),
135134
bot: Match.Maybe(Object),
136135
content: Match.Maybe(Object),
137136
e2e: Match.Maybe(String),

apps/meteor/app/otr/client/OTR.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)