-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix/color-tokens
- Loading branch information
Showing
118 changed files
with
2,174 additions
and
675 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
apps/meteor/app/e2e/server/functions/handleSuggestedGroupKey.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import { Subscriptions } from '@rocket.chat/models'; | ||
|
||
export async function handleSuggestedGroupKey( | ||
handle: 'accept' | 'reject', | ||
rid: string, | ||
userId: string | null, | ||
method: string, | ||
): Promise<void> { | ||
if (!userId) { | ||
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method }); | ||
} | ||
|
||
const sub = await Subscriptions.findOneByRoomIdAndUserId(rid, userId); | ||
if (!sub) { | ||
throw new Meteor.Error('error-subscription-not-found', 'Subscription not found', { method }); | ||
} | ||
|
||
const suggestedKey = String(sub.E2ESuggestedKey ?? '').trim(); | ||
if (!suggestedKey) { | ||
throw new Meteor.Error('error-no-suggested-key-available', 'No suggested key available', { method }); | ||
} | ||
|
||
if (handle === 'accept') { | ||
await Subscriptions.setGroupE2EKey(sub._id, suggestedKey); | ||
} | ||
|
||
await Subscriptions.unsetGroupE2ESuggestedKey(sub._id); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.