Page MenuHomePhabricator

D7054.id23928.diff
No OneTemporary

D7054.id23928.diff

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

Mime Type
text/plain
Expires
Mon, Nov 25, 2:36 PM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579775
Default Alt Text
D7054.id23928.diff (1 KB)

Event Timeline