Page MenuHomePhabricator

D12444.id41346.diff
No OneTemporary

D12444.id41346.diff

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

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)

Event Timeline