Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3366827
D11699.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D11699.diff
View Options
diff --git a/lib/actions/activity-actions.js b/lib/actions/activity-actions.js
--- a/lib/actions/activity-actions.js
+++ b/lib/actions/activity-actions.js
@@ -1,6 +1,7 @@
// @flow
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import type {
ActivityUpdate,
@@ -8,7 +9,6 @@
SetThreadUnreadStatusPayload,
SetThreadUnreadStatusRequest,
} from '../types/activity-types.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
export type UpdateActivityInput = {
+activityUpdates: $ReadOnlyArray<ActivityUpdate>,
diff --git a/lib/actions/device-actions.js b/lib/actions/device-actions.js
--- a/lib/actions/device-actions.js
+++ b/lib/actions/device-actions.js
@@ -1,13 +1,15 @@
// @flow
+import {
+ useKeyserverCall,
+ type KeyserverCallParamOverride,
+} from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import type {
GetVersionActionPayload,
DeviceTokenUpdateRequest,
} from '../types/device-types';
import { getConfig } from '../utils/config.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
-import type { KeyserverCallParamOverride } from '../utils/keyserver-call.js';
export type DeviceTokens = {
+[keyserverID: string]: ?string,
diff --git a/lib/actions/entry-actions.js b/lib/actions/entry-actions.js
--- a/lib/actions/entry-actions.js
+++ b/lib/actions/entry-actions.js
@@ -4,6 +4,7 @@
extractKeyserverIDFromID,
sortCalendarQueryPerKeyserver,
} from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import { getNextLocalID } from '../shared/message-utils.js';
import type {
@@ -22,7 +23,6 @@
} from '../types/entry-types.js';
import type { HistoryRevisionInfo } from '../types/history-types.js';
import { dateFromString } from '../utils/date-utils.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
const fetchEntriesActionTypes = Object.freeze({
started: 'FETCH_ENTRIES_STARTED',
diff --git a/lib/actions/link-actions.js b/lib/actions/link-actions.js
--- a/lib/actions/link-actions.js
+++ b/lib/actions/link-actions.js
@@ -3,6 +3,7 @@
import type { CallSingleKeyserverEndpoint } from '../keyserver-conn/call-single-keyserver-endpoint.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import type {
FetchInviteLinksResponse,
@@ -14,7 +15,6 @@
DisableInviteLinkPayload,
} from '../types/link-types.js';
import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
import { useSelector } from '../utils/redux-utils.js';
const verifyInviteLinkActionTypes = Object.freeze({
diff --git a/lib/actions/message-actions.js b/lib/actions/message-actions.js
--- a/lib/actions/message-actions.js
+++ b/lib/actions/message-actions.js
@@ -7,6 +7,7 @@
extractKeyserverIDFromID,
sortThreadIDsPerKeyserver,
} from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import type {
FetchMessageInfosPayload,
@@ -28,7 +29,6 @@
ToggleMessagePinRequest,
ToggleMessagePinResult,
} from '../types/thread-types.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
const fetchMessagesBeforeCursorActionTypes = Object.freeze({
started: 'FETCH_MESSAGES_BEFORE_CURSOR_STARTED',
diff --git a/lib/actions/message-report-actions.js b/lib/actions/message-report-actions.js
--- a/lib/actions/message-report-actions.js
+++ b/lib/actions/message-report-actions.js
@@ -1,12 +1,12 @@
// @flow
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import type {
MessageReportCreationRequest,
MessageReportCreationResult,
} from '../types/message-report-types.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
const sendMessageReportActionTypes = Object.freeze({
started: 'SEND_MESSAGE_REPORT_STARTED',
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
@@ -4,6 +4,7 @@
import genesis from '../facts/genesis.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import type {
ChangeThreadSettingsPayload,
@@ -20,7 +21,6 @@
RoleDeletionRequest,
RoleDeletionPayload,
} from '../types/thread-types.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
import { values } from '../utils/objects.js';
export type DeleteThreadInput = {
diff --git a/lib/actions/upload-actions.js b/lib/actions/upload-actions.js
--- a/lib/actions/upload-actions.js
+++ b/lib/actions/upload-actions.js
@@ -7,6 +7,7 @@
import blobService from '../facts/blob-service.js';
import type { CallSingleKeyserverEndpoint } from '../keyserver-conn/call-single-keyserver-endpoint.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import { type UploadBlob } from '../keyserver-conn/upload-blob.js';
import { IdentityClientContext } from '../shared/identity-client-context.js';
@@ -19,7 +20,6 @@
} from '../utils/blob-service-upload.js';
import { makeBlobServiceEndpointURL } from '../utils/blob-service.js';
import { getMessageForException } from '../utils/errors.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
import {
handleHTTPResponseError,
createDefaultHTTPRequestHeaders,
diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -12,6 +12,7 @@
sortThreadIDsPerKeyserver,
sortCalendarQueryPerKeyserver,
} from '../keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js';
import { usePreRequestUserState } from '../selectors/account-selectors.js';
import {
@@ -65,7 +66,6 @@
} from '../types/user-types.js';
import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js';
import { getConfig } from '../utils/config.js';
-import { useKeyserverCall } from '../utils/keyserver-call.js';
import { useSelector } from '../utils/redux-utils.js';
import { usingCommServicesAccessToken } from '../utils/services-utils.js';
import sleep from '../utils/sleep.js';
diff --git a/lib/utils/keyserver-call.js b/lib/keyserver-conn/keyserver-call.js
rename from lib/utils/keyserver-call.js
rename to lib/keyserver-conn/keyserver-call.js
--- a/lib/utils/keyserver-call.js
+++ b/lib/keyserver-conn/keyserver-call.js
@@ -3,18 +3,18 @@
import _memoize from 'lodash/memoize.js';
import * as React from 'react';
-import { promiseAll } from './promises.js';
-import { useSelector, useDispatch } from './redux-utils.js';
-import { useCallKeyserverEndpointContext } from '../keyserver-conn/call-keyserver-endpoint-provider.react.js';
-import type { CallSingleKeyserverEndpointOptions } from '../keyserver-conn/call-single-keyserver-endpoint.js';
+import { useCallKeyserverEndpointContext } from './call-keyserver-endpoint-provider.react.js';
+import type { CallSingleKeyserverEndpointOptions } from './call-single-keyserver-endpoint.js';
import {
useKeyserverCallInfos,
type KeyserverInfoPartial,
-} from '../keyserver-conn/keyserver-call-infos.js';
-import type { ActionFunc } from '../keyserver-conn/keyserver-conn-types.js';
+} from './keyserver-call-infos.js';
+import type { ActionFunc } from './keyserver-conn-types.js';
import type { Endpoint } from '../types/endpoints.js';
import type { Dispatch } from '../types/redux-types.js';
import type { CurrentUserInfo } from '../types/user-types.js';
+import { promiseAll } from '../utils/promises.js';
+import { useSelector, useDispatch } from '../utils/redux-utils.js';
export type KeyserverCallParamOverride = Partial<{
+dispatch: Dispatch,
diff --git a/web/redux/action-types.js b/web/redux/action-types.js
--- a/web/redux/action-types.js
+++ b/web/redux/action-types.js
@@ -1,13 +1,13 @@
// @flow
import { extractKeyserverIDFromID } from 'lib/keyserver-conn/keyserver-call-utils.js';
+import { useKeyserverCall } from 'lib/keyserver-conn/keyserver-call.js';
import type { CallKeyserverEndpoint } from 'lib/keyserver-conn/keyserver-conn-types.js';
import { defaultCalendarFilters } from 'lib/types/filter-types.js';
import type {
WebInitialKeyserverInfo,
ClientWebInitialReduxStateResponse,
} from 'lib/types/redux-types.js';
-import { useKeyserverCall } from 'lib/utils/keyserver-call.js';
import type { URLInfo } from 'lib/utils/url-utils.js';
import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 12:40 PM (18 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2584734
Default Alt Text
D11699.diff (9 KB)
Attached To
Mode
D11699: [lib][web] Move useKeyserverCall to lib/keyserver-conn
Attached
Detach File
Event Timeline
Log In to Comment