Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33204053
D7949.1768546438.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7949.1768546438.diff
View Options
diff --git a/lib/utils/url-utils.js b/lib/utils/url-utils.js
--- a/lib/utils/url-utils.js
+++ b/lib/utils/url-utils.js
@@ -12,6 +12,7 @@
+settings?: 'account' | 'danger-zone',
+threadCreation?: boolean,
+selectedUserList?: $ReadOnlyArray<string>,
+ +inviteSecret?: string,
...
};
@@ -33,6 +34,10 @@
'(/|^)thread/new(/([0-9]+([+][0-9]+)*))?(/|$)',
'i',
);
+const inviteLinkRegex = new RegExp(
+ '(/|^)handle/invite/([a-zA-Z0-9]+)(/|$)',
+ 'i',
+);
function infoFromURL(url: string): URLInfo {
const yearMatches = yearRegex.exec(url);
@@ -45,6 +50,7 @@
const dangerZoneTest = dangerZoneRegex.test(url);
const threadPendingMatches = threadPendingRegex.exec(url);
const threadCreateMatches = threadCreationRegex.exec(url);
+ const inviteLinkMatches = inviteLinkRegex.exec(url);
const returnObj = {};
if (yearMatches) {
@@ -70,6 +76,9 @@
if (verifyMatches) {
returnObj.verify = verifyMatches[2];
}
+ if (inviteLinkMatches) {
+ returnObj.inviteSecret = inviteLinkMatches[2];
+ }
if (calendarTest) {
returnObj.calendar = true;
} else if (chatTest) {
diff --git a/web/types/nav-types.js b/web/types/nav-types.js
--- a/web/types/nav-types.js
+++ b/web/types/nav-types.js
@@ -29,6 +29,7 @@
+settingsSection?: NavigationSettingsSection,
+selectedUserList?: $ReadOnlyArray<string>,
+chatMode?: NavigationChatMode,
+ +inviteSecret?: ?string,
};
export const navInfoValidator: TInterface<NavInfo> = tShape<$Exact<NavInfo>>({
@@ -40,4 +41,5 @@
settingsSection: t.maybe(navigationSettingsSectionValidator),
selectedUserList: t.maybe(t.list(t.String)),
chatMode: t.maybe(navigationChatModeValidator),
+ inviteSecret: t.maybe(t.String),
});
diff --git a/web/url-utils.js b/web/url-utils.js
--- a/web/url-utils.js
+++ b/web/url-utils.js
@@ -133,6 +133,10 @@
newNavInfo.settingsSection = urlInfo.settings;
}
+ if (urlInfo.inviteSecret) {
+ newNavInfo.inviteSecret = urlInfo.inviteSecret;
+ }
+
return newNavInfo;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 6:53 AM (13 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5938164
Default Alt Text
D7949.1768546438.diff (1 KB)
Attached To
Mode
D7949: [web] Parse invite link secret
Attached
Detach File
Event Timeline
Log In to Comment