Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3370650
D13819.id45468.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13819.id45468.diff
View Options
diff --git a/keyserver/src/creators/thread-creator.js b/keyserver/src/creators/thread-creator.js
--- a/keyserver/src/creators/thread-creator.js
+++ b/keyserver/src/creators/thread-creator.js
@@ -62,6 +62,7 @@
+forceAddMembers: boolean,
+updatesForCurrentSession: UpdatesForCurrentSession,
+silentlyFailMembers: boolean,
+ +addViewerAsGhost: boolean,
}>;
// If forceAddMembers is set, we will allow the viewer to add random users who
@@ -83,6 +84,7 @@
const updatesForCurrentSession =
options?.updatesForCurrentSession ?? 'return';
const silentlyFailMembers = options?.silentlyFailMembers ?? false;
+ const addViewerAsGhost = options?.addViewerAsGhost ?? false;
const threadType = request.type;
const shouldCreateRelationships =
@@ -357,13 +359,15 @@
? changeRole(id, ghostMemberIDs, -1)
: Promise.resolve(undefined);
+ const creatorRoleID = addViewerAsGhost ? -1 : newRoles.creator.id;
+
const [
creatorChangeset,
initialMembersChangeset,
ghostMembersChangeset,
recalculatePermissionsChangeset,
] = await Promise.all([
- changeRole(id, [viewer.userID], newRoles.creator.id),
+ changeRole(id, [viewer.userID], creatorRoleID),
initialMemberPromise,
ghostMemberPromise,
recalculateThreadPermissions(id),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 3:33 AM (19 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2587569
Default Alt Text
D13819.id45468.diff (1 KB)
Attached To
Mode
D13819: [keyserver] add the addViewerAsGhost option to createThread
Attached
Detach File
Event Timeline
Log In to Comment