Our current User information is lacking, which makes this hard. Consider a sample user returned from sourcegraph.Users.Get
:
user = (*sourcegraph.User)(&sourcegraph.User{
UID: (int32)(678271),
Login: (string)("shurcooL"),
Domain: (string)("sourcegraph.com"),
Name: (string)("Dmitri Shuralyov"),
IsOrganization: (bool)(false),
AvatarURL: (string)(""),
Location: (string)(""),
Company: (string)(""),
HomepageURL: (string)(""),
Disabled: (bool)(false),
Admin: (bool)(true),
RegisteredAt: (*pbtypes.Timestamp)(&pbtypes.Timestamp{
Seconds: (int64)(1438986218),
Nanos: (int32)(132002000),
}),
})
The first problem is there's no AvatarURL
set, and without knowing the user's private email, we can't even use Gravatar. Gravatar should be implemented on the sourcegraph User service side and return the result in AvatarURL
for apps to use.
The second thing that's needed is to get the domain of the current sourcegraph instance, since we'll want to link to users on the current instance rather than the upstream domain (sourcegraph.com in this case) where they're registered.
Resolved second task (thanks @pararthshah).
Also resolved first task, but it needs followup work to complete.
Resolved in f593820
.
Also using avatar images from GitHub, should use our own or Gravatar.