Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3360341
D7054.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7054.diff
View Options
diff --git a/keyserver/src/fetchers/user-fetchers.js b/keyserver/src/fetchers/user-fetchers.js
--- a/keyserver/src/fetchers/user-fetchers.js
+++ b/keyserver/src/fetchers/user-fetchers.js
@@ -200,7 +200,7 @@
viewer: Viewer,
): Promise<OldLoggedInUserInfo | LoggedInUserInfo> {
const userQuery = SQL`
- SELECT id, username
+ SELECT id, username, avatar
FROM users
WHERE id = ${viewer.userID}
`;
@@ -228,7 +228,7 @@
}
const id = userRow.id.toString();
- const { username } = userRow;
+ const { username, avatar } = userRow;
if (stillExpectsEmailFields) {
return {
@@ -239,18 +239,30 @@
};
}
+ let loggedInUserInfo: LoggedInUserInfo = {
+ id,
+ username,
+ };
+
+ const shouldIncludeAvatar = hasMinCodeVersion(viewer.platformDetails, 1000);
+
+ if (shouldIncludeAvatar && avatar) {
+ loggedInUserInfo = { ...loggedInUserInfo, avatar };
+ }
+
const featureGateSettings = !hasMinCodeVersion(viewer.platformDetails, 1000);
if (featureGateSettings) {
- return { id, username };
+ return loggedInUserInfo;
}
const settings = settingsResult.reduce((prev, curr) => {
prev[curr.name] = curr.data;
return prev;
}, {});
+ loggedInUserInfo = { ...loggedInUserInfo, settings };
- return { id, username, settings };
+ return loggedInUserInfo;
}
async function fetchAllUserIDs(): Promise<string[]> {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 12:39 PM (21 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579775
Default Alt Text
D7054.diff (1 KB)
Attached To
Mode
D7054: [keyserver/lib] fetch avatar column from users table in fetchCurrentUserInfo
Attached
Detach File
Event Timeline
Log In to Comment