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, + +dontAddViewerAsMember: boolean, }>; // If forceAddMembers is set, we will allow the viewer to add random users who @@ -358,17 +359,24 @@ : Promise.resolve(undefined); const [ - creatorChangeset, initialMembersChangeset, ghostMembersChangeset, recalculatePermissionsChangeset, ] = await Promise.all([ - changeRole(id, [viewer.userID], newRoles.creator.id), initialMemberPromise, ghostMemberPromise, recalculateThreadPermissions(id), ]); + let creatorChangeset: MembershipChangeset = { + membershipRows: [], + relationshipChangeset: new RelationshipChangeset(), + }; + + creatorChangeset = options?.dontAddViewerAsMember + ? creatorChangeset + : await changeRole(id, [viewer.userID], newRoles.creator.id); + const { membershipRows: creatorMembershipRows, relationshipChangeset: creatorRelationshipChangeset,