Page MenuHomePhabricator

D7073.diff
No OneTemporary

D7073.diff

diff --git a/keyserver/src/creators/role-creator.js b/keyserver/src/creators/role-creator.js
--- a/keyserver/src/creators/role-creator.js
+++ b/keyserver/src/creators/role-creator.js
@@ -14,8 +14,8 @@
import { dbQuery, SQL } from '../database/database.js';
type InitialRoles = {
- default: RoleInfo,
- creator: RoleInfo,
+ +default: RoleInfo,
+ +creator: RoleInfo,
};
async function createInitialRolesForNewThread(
threadID: string,
@@ -106,6 +106,7 @@
};
const baseMemberPermissions = {
...genesisMemberPermissions,
+ [threadPermissions.REACT_TO_MESSAGE]: true,
[threadPermissions.LEAVE_THREAD]: true,
[threadPermissions.CREATE_SIDEBARS]: true,
[threadPermissions.ADD_MEMBERS]: true,
@@ -153,6 +154,7 @@
[threadPermissions.KNOW_OF]: true,
[threadPermissions.VISIBLE]: true,
[threadPermissions.VOICED]: true,
+ [threadPermissions.REACT_TO_MESSAGE]: true,
[threadPermissions.EDIT_ENTRIES]: true,
[threadPermissions.EDIT_THREAD_NAME]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
@@ -201,6 +203,7 @@
if (threadType === threadTypes.SIDEBAR) {
const memberPermissions = {
[threadPermissions.VOICED]: true,
+ [threadPermissions.REACT_TO_MESSAGE]: true,
[threadPermissions.EDIT_THREAD_NAME]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
[threadPermissions.EDIT_THREAD_DESCRIPTION]: true,
@@ -223,6 +226,7 @@
[threadPermissions.KNOW_OF]: true,
[threadPermissions.VISIBLE]: true,
[threadPermissions.VOICED]: true,
+ [threadPermissions.REACT_TO_MESSAGE]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
[threadPermissions.EDIT_THREAD_DESCRIPTION]: true,
[threadPermissions.CREATE_SIDEBARS]: true,
@@ -242,6 +246,7 @@
[threadPermissions.KNOW_OF]: true,
[threadPermissions.VISIBLE]: true,
[threadPermissions.VOICED]: true,
+ [threadPermissions.REACT_TO_MESSAGE]: true,
[threadPermissions.EDIT_ENTRIES]: true,
[threadPermissions.EDIT_THREAD_NAME]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
@@ -260,6 +265,7 @@
const subthreadBasePermissions = {
[threadPermissions.KNOW_OF]: true,
[threadPermissions.VISIBLE]: true,
+ [threadPermissions.REACT_TO_MESSAGE]: true,
[threadPermissions.CREATE_SIDEBARS]: true,
[threadPermissions.LEAVE_THREAD]: true,
[openDescendantKnowOf]: true,
diff --git a/keyserver/src/database/migration-config.js b/keyserver/src/database/migration-config.js
--- a/keyserver/src/database/migration-config.js
+++ b/keyserver/src/database/migration-config.js
@@ -204,6 +204,7 @@
},
],
[18, updateRolesAndPermissionsForAllThreads],
+ [19, updateRolesAndPermissionsForAllThreads],
]);
const newDatabaseVersion: number = Math.max(...migrations.keys());
diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js
--- a/lib/types/thread-types.js
+++ b/lib/types/thread-types.js
@@ -98,6 +98,7 @@
REMOVE_MEMBERS: 'remove_members',
CHANGE_ROLE: 'change_role',
LEAVE_THREAD: 'leave_thread',
+ REACT_TO_MESSAGE: 'react_to_message',
});
export type ThreadPermission = $Values<typeof threadPermissions>;
export function assertThreadPermissions(
@@ -120,7 +121,8 @@
ourThreadPermissions === 'add_members' ||
ourThreadPermissions === 'remove_members' ||
ourThreadPermissions === 'change_role' ||
- ourThreadPermissions === 'leave_thread',
+ ourThreadPermissions === 'leave_thread' ||
+ ourThreadPermissions === 'react_to_message',
'string is not threadPermissions enum',
);
return ourThreadPermissions;

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 5:22 AM (17 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2698456
Default Alt Text
D7073.diff (3 KB)

Event Timeline