Page MenuHomePhabricator

D13057.id43505.diff
No OneTemporary

D13057.id43505.diff

diff --git a/lib/shared/updates/join-thread-spec.js b/lib/shared/updates/join-thread-spec.js
--- a/lib/shared/updates/join-thread-spec.js
+++ b/lib/shared/updates/join-thread-spec.js
@@ -178,4 +178,7 @@
truncationStatus: messageTruncationStatusValidator,
rawEntryInfos: t.list(rawEntryInfoValidator),
}),
+ getUpdatedThreadInfo(update: ThreadJoinUpdateInfo) {
+ return update.threadInfo;
+ },
});
diff --git a/lib/shared/updates/update-spec.js b/lib/shared/updates/update-spec.js
--- a/lib/shared/updates/update-spec.js
+++ b/lib/shared/updates/update-spec.js
@@ -14,9 +14,11 @@
MessageTruncationStatuses,
FetchMessageInfosResult,
} from '../../types/message-types.js';
+import type { RawThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js';
import type {
RawThreadInfos,
MixedRawThreadInfos,
+ LegacyRawThreadInfo,
} from '../../types/thread-types.js';
import type { UpdateType } from '../../types/update-types-enum.js';
import type {
@@ -103,4 +105,8 @@
+generateOpsForUserInfoUpdates?: (
update: UpdateInfo,
) => ?$ReadOnlyArray<UserStoreOperation>,
+ +getUpdatedThreadInfo?: (
+ update: UpdateInfo,
+ threadInfos: RawThreadInfos,
+ ) => ?(LegacyRawThreadInfo | RawThreadInfo),
};
diff --git a/lib/shared/updates/update-thread-read-status-spec.js b/lib/shared/updates/update-thread-read-status-spec.js
--- a/lib/shared/updates/update-thread-read-status-spec.js
+++ b/lib/shared/updates/update-thread-read-status-spec.js
@@ -3,7 +3,11 @@
import t from 'tcomb';
import type { UpdateSpec } from './update-spec.js';
-import type { RawThreadInfos } from '../../types/thread-types.js';
+import type { RawThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js';
+import type {
+ LegacyRawThreadInfo,
+ RawThreadInfos,
+} from '../../types/thread-types.js';
import { updateTypes } from '../../types/update-types-enum.js';
import type {
ThreadReadStatusUpdateInfo,
@@ -106,4 +110,19 @@
threadID: tID,
unread: t.Boolean,
}),
+ getUpdatedThreadInfo(
+ update: ThreadReadStatusUpdateInfo,
+ threadInfos: RawThreadInfos,
+ ): ?(LegacyRawThreadInfo | RawThreadInfo) {
+ if (!threadInfos[update.threadID]) {
+ return null;
+ }
+ return {
+ ...threadInfos[update.threadID],
+ currentUser: {
+ ...threadInfos[update.threadID].currentUser,
+ unread: update.unread,
+ },
+ };
+ },
});
diff --git a/lib/shared/updates/update-thread-spec.js b/lib/shared/updates/update-thread-spec.js
--- a/lib/shared/updates/update-thread-spec.js
+++ b/lib/shared/updates/update-thread-spec.js
@@ -119,4 +119,7 @@
time: t.Number,
threadInfo: mixedRawThreadInfoValidator,
}),
+ getUpdatedThreadInfo(update: ThreadUpdateInfo) {
+ return update.threadInfo;
+ },
});

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 8:50 PM (20 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2580945
Default Alt Text
D13057.id43505.diff (2 KB)

Event Timeline