Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3528999
D12444.id41346.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
D12444.id41346.diff
View Options
diff --git a/keyserver/src/updaters/thread-permission-updaters.js b/keyserver/src/updaters/thread-permission-updaters.js
--- a/keyserver/src/updaters/thread-permission-updaters.js
+++ b/keyserver/src/updaters/thread-permission-updaters.js
@@ -60,6 +60,7 @@
+role: string,
+oldRole: string,
+unread?: boolean,
+ +setSubcriptionToDefault?: boolean,
};
type MembershipRowToDelete = {
+operation: 'delete',
@@ -81,6 +82,7 @@
type ChangeRoleOptions = {
+setNewMembersToUnread?: boolean,
+forcePermissionRecalculation?: boolean,
+ +setSubcriptionToDefault?: boolean,
};
type ChangeRoleMemberInfo = {
permissionsFromParent?: ?ThreadPermissionsBlob,
@@ -101,6 +103,7 @@
const setNewMembersToUnread =
options?.setNewMembersToUnread && intent === 'join';
const forcePermissionRecalculation = options?.forcePermissionRecalculation;
+ const setSubcriptionToDefault = options?.setSubcriptionToDefault;
if (userIDs.length === 0) {
return {
@@ -291,6 +294,7 @@
role: newRole,
oldRole,
unread: userBecameMember && setNewMembersToUnread,
+ setSubcriptionToDefault,
});
} else {
membershipRows.push({
@@ -934,9 +938,9 @@
rowToSave.threadID,
rowToSave.role,
time,
- rowToSave.intent === 'join'
- ? joinSubscriptionString
- : defaultSubscriptionString,
+ rowToSave.intent !== 'join' || rowToSave.setSubcriptionToDefault
+ ? defaultSubscriptionString
+ : joinSubscriptionString,
rowToSave.permissions ? JSON.stringify(rowToSave.permissions) : null,
rowToSave.permissionsForChildren
? JSON.stringify(rowToSave.permissionsForChildren)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 11:45 AM (11 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2702612
Default Alt Text
D12444.id41346.diff (1 KB)
Attached To
Mode
D12444: [keyserver] introduce setSubcriptionToDefault option in changeRole
Attached
Detach File
Event Timeline
Log In to Comment