Skip to content

Commit 17e9343

Browse files
committed
Bitbucket: remove special treatment of gravatar URLs
Revert 67200e5 Fixes #36 I honestly don't even remember why I added this. I think the goal was to correctly display the user name initials if they don't have a profile picture, but that use case seems to still work fine after removing this.
1 parent a097bd6 commit 17e9343

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

app/src/ui/lib/avatar.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { API, getDotComAPIEndpoint, getHTMLURL } from '../../lib/api'
55
import { TooltippedContent } from './tooltipped-content'
66
import { TooltipDirection } from './tooltip'
77
import {
8-
isBitbucket,
98
isGHE,
109
isGHES,
1110
supportsAvatarsAPI,
@@ -215,17 +214,6 @@ function getEmailAvatarUrl(ep: string) {
215214
}
216215
}
217216

218-
function resolveBitbucketAvatarURL(avatarURL: string) {
219-
const url = new URL(avatarURL)
220-
if (url.hostname === 'secure.gravatar.com' && url.searchParams.has('d')) {
221-
const d = url.searchParams.get('d')
222-
if (d && d.startsWith('https://')) {
223-
return d
224-
}
225-
}
226-
return null
227-
}
228-
229217
/**
230218
* Produces an ordered iterable of avatar urls to attempt to load for the
231219
* given user.
@@ -244,13 +232,6 @@ function getAvatarUrlCandidates(
244232
const { email, avatarURL } = user
245233
const ep = user.endpoint ?? getDotComAPIEndpoint()
246234

247-
if (isBitbucket(ep) && avatarURL) {
248-
const resolvedAvatarURL = resolveBitbucketAvatarURL(avatarURL)
249-
if (resolvedAvatarURL) {
250-
candidates.push(resolvedAvatarURL)
251-
}
252-
}
253-
254235
// By leveraging the avatar url from the API (if we've got it) we can
255236
// load the avatar from one of the load balanced domains (avatars). We can't
256237
// do the same for GHES/GHAE however since the URLs returned by the API are

0 commit comments

Comments
 (0)