Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/responders/thread-responders.js
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | async function threadCreationResponder( | ||||
viewer: Viewer, | viewer: Viewer, | ||||
input: any, | input: any, | ||||
): Promise<NewThreadResponse> { | ): Promise<NewThreadResponse> { | ||||
const request: ServerNewThreadRequest = input; | const request: ServerNewThreadRequest = input; | ||||
await validateInput(viewer, newThreadRequestInputValidator, request); | await validateInput(viewer, newThreadRequestInputValidator, request); | ||||
return await createThread(viewer, request, { | return await createThread(viewer, request, { | ||||
silentlyFailMembers: request.type === threadTypes.SIDEBAR, | silentlyFailMembers: request.type === threadTypes.SIDEBAR, | ||||
forceAddMembers: true, | |||||
tomek: This doesn't sound like a good idea to force add members.
In `createThread` we use this flag… | |||||
ashoatUnsubmitted Not Done Inline ActionsIt should not be possible to create a group chat that includes somebody you are not friends with. However, it should be possible to create a chat with a single person who you are not friends with. This distinction introduces some complexity to the UI:
Sorry I didn't think to call this out sooner!! ashoat: It should not be possible to create a group chat that includes somebody you are not friends… | |||||
}); | }); | ||||
} | } | ||||
const joinThreadRequestInputValidator = tShape({ | const joinThreadRequestInputValidator = tShape({ | ||||
threadID: t.String, | threadID: t.String, | ||||
calendarQuery: t.maybe(entryQueryInputValidator), | calendarQuery: t.maybe(entryQueryInputValidator), | ||||
}); | }); | ||||
async function threadJoinResponder( | async function threadJoinResponder( | ||||
Show All 23 Lines |
This doesn't sound like a good idea to force add members.
In createThread we use this flag:
So it seems like we should avoid checking relationship, but checking containing thread membership should still happen (@ashoat correct me if I'm wrong).
The fact that this change was necessary seems to be caused by how searchForUsers function works - it doesn't check if the users are members of containing thread. This is ok for friend / block, but doesn't seem to be correct for chat creation.