Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3400002
D7333.id24757.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7333.id24757.diff
View Options
diff --git a/keyserver/src/fetchers/thread-fetchers.js b/keyserver/src/fetchers/thread-fetchers.js
--- a/keyserver/src/fetchers/thread-fetchers.js
+++ b/keyserver/src/fetchers/thread-fetchers.js
@@ -38,7 +38,7 @@
const threadsQuery = SQL`
SELECT t.id, t.name, t.parent_thread_id, t.containing_thread_id,
t.community, t.depth, t.color, t.description, t.type, t.creation_time,
- t.source_message, t.replies_count, m.user, m.role, m.permissions,
+ t.source_message, t.replies_count, t.avatar, m.user, m.role, m.permissions,
m.subscription, m.last_read_message < m.last_message AS unread, m.sender
FROM threads t
LEFT JOIN memberships m ON m.thread = t.id AND m.role >= 0
@@ -75,6 +75,12 @@
roles: {},
repliesCount: threadsRow.replies_count,
};
+ if (threadsRow.avatar) {
+ threadInfos[threadID] = {
+ ...threadInfos[threadID],
+ avatar: JSON.parse(threadsRow.avatar),
+ };
+ }
}
const sourceMessageID = threadsRow.source_message?.toString();
if (sourceMessageID) {
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
@@ -803,6 +803,9 @@
if (sourceMessageID) {
rawThreadInfo = { ...rawThreadInfo, sourceMessageID };
}
+ if (serverThreadInfo.avatar) {
+ rawThreadInfo = { ...rawThreadInfo, avatar: serverThreadInfo.avatar };
+ }
if (includeVisibilityRules) {
return {
...rawThreadInfo,
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
@@ -2,7 +2,11 @@
import invariant from 'invariant';
-import type { ClientAvatar, UpdateUserAvatarRequest } from './avatar-types.js';
+import type {
+ AvatarDBContent,
+ ClientAvatar,
+ UpdateUserAvatarRequest,
+} from './avatar-types.js';
import type { Shape } from './core.js';
import type { CalendarQuery, RawEntryInfo } from './entry-types.js';
import type { Media } from './media-types.js';
@@ -264,6 +268,7 @@
+id: string,
+type: ThreadType,
+name: ?string,
+ +avatar?: AvatarDBContent,
+description: ?string,
+color: string, // hex, without "#" or "0x"
+creationTime: number, // millisecond timestamp
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 5:49 AM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2610087
Default Alt Text
D7333.id24757.diff (2 KB)
Attached To
Mode
D7333: [keyserver] Update `fetchServerThreadInfos` to include `avatar` field
Attached
Detach File
Event Timeline
Log In to Comment