Skip to content

Commit 4ee179f

Browse files
author
Forge
committed
fix(avatar): stop treating random strings as GitHub usernames
This prevents the app from pulling random people's GitHub avatars when the local-part of an email or the commit author name doesn't belong to them (which resolves to placeholder/default images or incorrect users).
1 parent 99d9f6e commit 4ee179f

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

crates/rgitui_workspace/src/avatar_resolver.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,35 +104,6 @@ async fn resolve_single(name: &str, email: &str, http: &Arc<dyn HttpClient>) ->
104104
}));
105105
}
106106

107-
if !name.is_empty() && !name.contains(' ') {
108-
let name_url = format!("https://github.com/{}.png?size=48", name);
109-
let http = http.clone();
110-
batch1.push(Box::pin(async move {
111-
if check_url_with_timeout(&http, &name_url).await {
112-
Some(name_url)
113-
} else {
114-
None
115-
}
116-
}));
117-
}
118-
119-
if let Some(local) = email.split('@').next() {
120-
if !local.is_empty() && local != name {
121-
let clean = local.split('+').next_back().unwrap_or(local);
122-
if !clean.is_empty() {
123-
let local_url = format!("https://github.com/{}.png?size=48", clean);
124-
let http = http.clone();
125-
batch1.push(Box::pin(async move {
126-
if check_url_with_timeout(&http, &local_url).await {
127-
Some(local_url)
128-
} else {
129-
None
130-
}
131-
}));
132-
}
133-
}
134-
}
135-
136107
{
137108
let gravatar = gravatar_url(email, 48);
138109
let http = http.clone();

0 commit comments

Comments
 (0)