Page MenuHomePhabricator

D7300.diff
No OneTemporary

D7300.diff

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
@@ -302,7 +302,7 @@
+id: string,
+type: number,
+name: ?string,
- +avatar?: ?ClientAvatar,
+ +avatar?: ?string,
+description: ?string,
+color: string,
+creationTime: string,
diff --git a/lib/utils/thread-ops-utils.js b/lib/utils/thread-ops-utils.js
--- a/lib/utils/thread-ops-utils.js
+++ b/lib/utils/thread-ops-utils.js
@@ -17,26 +17,43 @@
members: JSON.stringify(rawThreadInfo.members),
roles: JSON.stringify(rawThreadInfo.roles),
currentUser: JSON.stringify(rawThreadInfo.currentUser),
+ avatar: rawThreadInfo.avatar ? JSON.stringify(rawThreadInfo.avatar) : null,
};
}
function convertClientDBThreadInfoToRawThreadInfo(
clientDBThreadInfo: ClientDBThreadInfo,
): RawThreadInfo {
- const { sourceMessageID, ...rawThreadInfo }: RawThreadInfo = {
- ...clientDBThreadInfo,
+ let rawThreadInfo: RawThreadInfo = {
+ id: clientDBThreadInfo.id,
type: assertThreadType(clientDBThreadInfo.type),
+ name: clientDBThreadInfo.name,
+ description: clientDBThreadInfo.description,
+ color: clientDBThreadInfo.color,
creationTime: Number(clientDBThreadInfo.creationTime),
+ parentThreadID: clientDBThreadInfo.parentThreadID,
+ containingThreadID: clientDBThreadInfo.containingThreadID,
+ community: clientDBThreadInfo.community,
members: JSON.parse(clientDBThreadInfo.members),
roles: JSON.parse(clientDBThreadInfo.roles),
currentUser: JSON.parse(clientDBThreadInfo.currentUser),
+ repliesCount: clientDBThreadInfo.repliesCount,
};
+
if (clientDBThreadInfo.sourceMessageID) {
- return {
+ rawThreadInfo = {
...rawThreadInfo,
sourceMessageID: clientDBThreadInfo.sourceMessageID,
};
}
+
+ if (clientDBThreadInfo.avatar) {
+ rawThreadInfo = {
+ ...rawThreadInfo,
+ avatar: JSON.parse(clientDBThreadInfo.avatar),
+ };
+ }
+
return rawThreadInfo;
}

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 9:09 AM (2 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611127
Default Alt Text
D7300.diff (1 KB)

Event Timeline