Page MenuHomePhabricator

D8615.id29011.diff
No OneTemporary

D8615.id29011.diff

diff --git a/keyserver/src/creators/invite-link-creator.js b/keyserver/src/creators/invite-link-creator.js
--- a/keyserver/src/creators/invite-link-creator.js
+++ b/keyserver/src/creators/invite-link-creator.js
@@ -8,6 +8,7 @@
} from 'lib/types/link-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { ServerError } from 'lib/utils/errors.js';
+import { reservedUsernamesSet } from 'lib/utils/reserved-users.js';
import createIDs from './id-creator.js';
import {
@@ -33,6 +34,9 @@
if (badWordsFilter.isProfane(request.name)) {
throw new ServerError('offensive_words');
}
+ if (reservedUsernamesSet.has(request.name)) {
+ throw new ServerError('link_reserved');
+ }
const permissionPromise = checkThreadPermission(
viewer,
diff --git a/lib/shared/invite-links.js b/lib/shared/invite-links.js
--- a/lib/shared/invite-links.js
+++ b/lib/shared/invite-links.js
@@ -1,9 +1,12 @@
// @flow
-const inviteLinkErrorMessages = {
+const inviteLinkErrorMessages: { +[string]: string } = {
invalid_characters: 'Link cannot contain any spaces or special characters',
offensive_words: 'No offensive or abusive words allowed',
already_in_use: 'Public link URL already in use',
+ link_reserved:
+ 'This public link is currently reserved. Please contact support@' +
+ 'comm.app if you would like to claim this link.',
};
const defaultErrorMessage = 'unknown error';

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 9:50 PM (3 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701062
Default Alt Text
D8615.id29011.diff (1 KB)

Event Timeline