Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3367990
D12486.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D12486.diff
View Options
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
@@ -19,7 +19,7 @@
threadTypeIsCommunityRoot,
} from 'lib/types/thread-types-enum.js';
import {
- type ServerNewThreadRequest,
+ type ServerNewThinThreadRequest,
type NewThreadResponse,
} from 'lib/types/thread-types.js';
import type { ServerUpdateInfo } from 'lib/types/update-types.js';
@@ -78,7 +78,7 @@
// nonnegative role for the parent thread.
async function createThread(
viewer: Viewer,
- request: ServerNewThreadRequest,
+ request: ServerNewThinThreadRequest,
options?: CreateThreadOptions,
): Promise<NewThreadResponse> {
if (!viewer.loggedIn) {
diff --git a/keyserver/src/responders/thread-responders.js b/keyserver/src/responders/thread-responders.js
--- a/keyserver/src/responders/thread-responders.js
+++ b/keyserver/src/responders/thread-responders.js
@@ -13,7 +13,7 @@
type LeaveThreadRequest,
type LeaveThreadResult,
type UpdateThreadRequest,
- type ServerNewThreadRequest,
+ type ServerNewThinThreadRequest,
type NewThreadResponse,
type ServerThreadJoinRequest,
type ThreadJoinResult,
@@ -144,29 +144,30 @@
initialMemberIDs: t.maybe(t.list(tUserID)),
calendarQuery: t.maybe(entryQueryInputValidator),
};
-const newThreadRequestInputValidator: TUnion<ServerNewThreadRequest> = t.union([
- tShape({
- type: tNumEnum([threadTypes.SIDEBAR]),
- sourceMessageID: tID,
- ...threadRequestValidationShape,
- }),
- tShape({
- type: tNumEnum([
- threadTypes.COMMUNITY_OPEN_SUBTHREAD,
- threadTypes.COMMUNITY_SECRET_SUBTHREAD,
- threadTypes.GENESIS_PERSONAL,
- threadTypes.COMMUNITY_ROOT,
- threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT,
- threadTypes.COMMUNITY_OPEN_ANNOUNCEMENT_SUBTHREAD,
- threadTypes.COMMUNITY_SECRET_ANNOUNCEMENT_SUBTHREAD,
- ]),
- ...threadRequestValidationShape,
- }),
-]);
+const newThreadRequestInputValidator: TUnion<ServerNewThinThreadRequest> =
+ t.union([
+ tShape({
+ type: tNumEnum([threadTypes.SIDEBAR]),
+ sourceMessageID: tID,
+ ...threadRequestValidationShape,
+ }),
+ tShape({
+ type: tNumEnum([
+ threadTypes.COMMUNITY_OPEN_SUBTHREAD,
+ threadTypes.COMMUNITY_SECRET_SUBTHREAD,
+ threadTypes.GENESIS_PERSONAL,
+ threadTypes.COMMUNITY_ROOT,
+ threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT,
+ threadTypes.COMMUNITY_OPEN_ANNOUNCEMENT_SUBTHREAD,
+ threadTypes.COMMUNITY_SECRET_ANNOUNCEMENT_SUBTHREAD,
+ ]),
+ ...threadRequestValidationShape,
+ }),
+ ]);
async function threadCreationResponder(
viewer: Viewer,
- request: ServerNewThreadRequest,
+ request: ServerNewThinThreadRequest,
): Promise<NewThreadResponse> {
return await createThread(viewer, request, {
silentlyFailMembers: request.type === threadTypes.SIDEBAR,
diff --git a/lib/actions/thread-actions.js b/lib/actions/thread-actions.js
--- a/lib/actions/thread-actions.js
+++ b/lib/actions/thread-actions.js
@@ -11,7 +11,7 @@
ChangeThreadSettingsPayload,
LeaveThreadPayload,
UpdateThreadRequest,
- ClientNewThreadRequest,
+ ClientNewThinThreadRequest,
NewThreadResult,
ClientThreadJoinRequest,
ThreadJoinPayload,
@@ -207,7 +207,7 @@
const newThinThread =
(
callKeyserverEndpoint: CallKeyserverEndpoint,
- ): ((input: ClientNewThreadRequest) => Promise<NewThreadResult>) =>
+ ): ((input: ClientNewThinThreadRequest) => Promise<NewThreadResult>) =>
async input => {
const parentThreadID = input.parentThreadID ?? genesis().id;
const keyserverID = extractKeyserverIDFromID(parentThreadID);
@@ -225,7 +225,7 @@
};
function useNewThinThread(): (
- input: ClientNewThreadRequest,
+ input: ClientNewThinThreadRequest,
) => Promise<NewThreadResult> {
return useKeyserverCall(newThinThread);
}
diff --git a/lib/shared/thread-actions-utils.js b/lib/shared/thread-actions-utils.js
--- a/lib/shared/thread-actions-utils.js
+++ b/lib/shared/thread-actions-utils.js
@@ -20,7 +20,7 @@
import { threadTypes } from '../types/thread-types-enum.js';
import type {
ChangeThreadSettingsPayload,
- ClientNewThreadRequest,
+ ClientNewThinThreadRequest,
NewThreadResult,
} from '../types/thread-types.js';
import type { DispatchActionPromise } from '../utils/redux-promise-utils.js';
@@ -47,7 +47,7 @@
type CreateRealThreadParameters = {
+threadInfo: ThreadInfo,
+dispatchActionPromise: DispatchActionPromise,
- +createNewThinThread: ClientNewThreadRequest => Promise<NewThreadResult>,
+ +createNewThinThread: ClientNewThinThreadRequest => Promise<NewThreadResult>,
+sourceMessageID: ?string,
+viewerID: ?string,
+handleError?: () => mixed,
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
@@ -261,7 +261,7 @@
+initialMemberIDs?: ?$ReadOnlyArray<string>,
+ghostMemberIDs?: ?$ReadOnlyArray<string>,
};
-type NewThreadRequest =
+type NewThinThreadRequest =
| {
+type: 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12,
...BaseNewThreadRequest,
@@ -272,12 +272,12 @@
...BaseNewThreadRequest,
};
-export type ClientNewThreadRequest = {
- ...NewThreadRequest,
+export type ClientNewThinThreadRequest = {
+ ...NewThinThreadRequest,
+calendarQuery: CalendarQuery,
};
-export type ServerNewThreadRequest = {
- ...NewThreadRequest,
+export type ServerNewThinThreadRequest = {
+ ...NewThinThreadRequest,
+calendarQuery?: ?CalendarQuery,
};
diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js
--- a/native/input/input-state-container.react.js
+++ b/native/input/input-state-container.react.js
@@ -85,7 +85,7 @@
} from 'lib/types/report-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import {
- type ClientNewThreadRequest,
+ type ClientNewThinThreadRequest,
type NewThreadResult,
} from 'lib/types/thread-types.js';
import { getConfig } from 'lib/utils/config.js';
@@ -155,7 +155,9 @@
input: SendMultimediaMessageInput,
) => Promise<SendMessageResult>,
+sendTextMessage: (input: SendTextMessageInput) => Promise<SendMessageResult>,
- +newThinThread: (request: ClientNewThreadRequest) => Promise<NewThreadResult>,
+ +newThinThread: (
+ request: ClientNewThinThreadRequest,
+ ) => Promise<NewThreadResult>,
+textMessageCreationSideEffectsFunc: CreationSideEffectsFunc<RawTextMessageInfo>,
};
type State = {
diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js
--- a/web/input/input-state-container.react.js
+++ b/web/input/input-state-container.react.js
@@ -82,7 +82,7 @@
import { reportTypes } from 'lib/types/report-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import {
- type ClientNewThreadRequest,
+ type ClientNewThinThreadRequest,
type NewThreadResult,
} from 'lib/types/thread-types.js';
import {
@@ -149,7 +149,9 @@
input: LegacySendMultimediaMessageInput,
) => Promise<SendMessageResult>,
+sendTextMessage: (input: SendTextMessageInput) => Promise<SendMessageResult>,
- +newThinThread: (request: ClientNewThreadRequest) => Promise<NewThreadResult>,
+ +newThinThread: (
+ request: ClientNewThinThreadRequest,
+ ) => Promise<NewThreadResult>,
+pushModal: PushModal,
+sendCallbacks: $ReadOnlyArray<() => mixed>,
+registerSendCallback: (() => mixed) => void,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 5:41 PM (20 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585619
Default Alt Text
D12486.diff (7 KB)
Attached To
Mode
D12486: [keyserver][lib][native][web] NewThreadRequest -> NewThinThreadRequest
Attached
Detach File
Event Timeline
Log In to Comment