Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3261760
D13488.id44676.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D13488.id44676.diff
View Options
diff --git a/lib/hooks/relationship-hooks.js b/lib/hooks/relationship-hooks.js
--- a/lib/hooks/relationship-hooks.js
+++ b/lib/hooks/relationship-hooks.js
@@ -12,7 +12,7 @@
import { dmOperationSpecificationTypes } from '../shared/dm-ops/dm-op-utils.js';
import { useProcessAndSendDMOperation } from '../shared/dm-ops/process-dm-ops.js';
import {
- userSupportsThickThreads,
+ userHasDeviceList,
getPendingThreadID,
} from '../shared/thread-utils.js';
import type { RelationshipOperation } from '../types/messages/update-relationship.js';
@@ -123,10 +123,7 @@
}
const planForUsers = new Map<string, RobotextPlanForUser>();
for (const userID of userIDs) {
- const supportsThickThreads = userSupportsThickThreads(
- userID,
- auxUserInfos,
- );
+ const supportsThickThreads = userHasDeviceList(userID, auxUserInfos);
if (!supportsThickThreads) {
planForUsers.set(userID, { plan: 'send_to_thin_thread' });
continue;
@@ -266,10 +263,7 @@
}
const { action, userIDs, waitingForUserIDs, resolve, reject } = step;
for (const userID of waitingForUserIDs) {
- const supportsThickThreads = userSupportsThickThreads(
- userID,
- auxUserInfos,
- );
+ const supportsThickThreads = userHasDeviceList(userID, auxUserInfos);
if (!supportsThickThreads) {
// It's safe to wait until every single user ID in waitingForUserIDs
// passes this check because we make the same check when populating
@@ -313,10 +307,7 @@
const missingDeviceListsUserIDs: Array<string> = [];
for (const userID of userIDs) {
- const supportsThickThreads = userSupportsThickThreads(
- userID,
- auxUserInfos,
- );
+ const supportsThickThreads = userHasDeviceList(userID, auxUserInfos);
if (!supportsThickThreads) {
missingDeviceListsUserIDs.push(userID);
}
diff --git a/lib/shared/dm-ops/dm-op-utils.js b/lib/shared/dm-ops/dm-op-utils.js
--- a/lib/shared/dm-ops/dm-op-utils.js
+++ b/lib/shared/dm-ops/dm-op-utils.js
@@ -50,7 +50,7 @@
import { getContentSigningKey } from '../../utils/crypto-utils.js';
import { useSelector } from '../../utils/redux-utils.js';
import { messageSpecs } from '../messages/message-specs.js';
-import { userSupportsThickThreads } from '../thread-utils.js';
+import { userHasDeviceList } from '../thread-utils.js';
import { updateSpecs } from '../updates/update-specs.js';
function generateMessagesToPeers(
@@ -137,10 +137,7 @@
(userIDs: $ReadOnlyArray<string>) => {
const missingDeviceListsUserIDs: Array<string> = [];
for (const userID of userIDs) {
- const supportsThickThreads = userSupportsThickThreads(
- userID,
- auxUserInfos,
- );
+ const supportsThickThreads = userHasDeviceList(userID, auxUserInfos);
if (!supportsThickThreads) {
missingDeviceListsUserIDs.push(userID);
}
diff --git a/lib/shared/search-utils.js b/lib/shared/search-utils.js
--- a/lib/shared/search-utils.js
+++ b/lib/shared/search-utils.js
@@ -7,7 +7,7 @@
import {
getContainingThreadID,
userIsMember,
- userSupportsThickThreads,
+ userHasDeviceList,
} from './thread-utils.js';
import {
searchMessagesActionTypes,
@@ -165,7 +165,7 @@
return !!(
threadType &&
threadTypeIsThick(threadType) &&
- !userSupportsThickThreads(userID, auxUserInfos)
+ !userHasDeviceList(userID, auxUserInfos)
);
},
[auxUserInfos, excludeUserIDs, threadType],
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
@@ -6,7 +6,7 @@
threadIsPending,
threadOtherMembers,
pendingThreadType,
- userSupportsThickThreads,
+ userHasDeviceList,
} from './thread-utils.js';
import {
newThreadActionTypes,
@@ -138,7 +138,7 @@
'otherMemberIDs should not be empty for threads',
);
const allUsersSupportThickThreads = otherMemberIDs.every(memberID =>
- userSupportsThickThreads(memberID, auxUserInfos),
+ userHasDeviceList(memberID, auxUserInfos),
);
if (threadTypeIsThick(threadInfo.type) && allUsersSupportThickThreads) {
const type = assertThickThreadType(
diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -1798,7 +1798,7 @@
};
}
-function userSupportsThickThreads(
+function userHasDeviceList(
userID: string,
auxUserInfos: AuxUserInfos,
): boolean {
@@ -1874,5 +1874,5 @@
extractMentionedMembers,
isMemberActive,
createThreadTimestamps,
- userSupportsThickThreads,
+ userHasDeviceList,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 11:25 PM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2507110
Default Alt Text
D13488.id44676.diff (4 KB)
Attached To
Mode
D13488: [lib] rename `userSupportsThickThreads` -> `userHasDeviceList`
Attached
Detach File
Event Timeline
Log In to Comment