From ce5c60bffeede74497feb338944d7c5d98016191 Mon Sep 17 00:00:00 2001 From: Bat Date: Tue, 1 May 2018 12:52:50 +0100 Subject: [PATCH] Save the correct instance URL in the database --- src/models/users.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/users.rs b/src/models/users.rs index 3b00ac0..6374b3f 100644 --- a/src/models/users.rs +++ b/src/models/users.rs @@ -106,7 +106,7 @@ impl User { } fn fetch_from_webfinger(conn: &PgConnection, acct: String) -> Option { - match resolve(acct) { + match resolve(acct.clone()) { Ok(url) => { let req = Client::new() .get(&url[..]) @@ -115,7 +115,7 @@ impl User { match req { Ok(mut res) => { let json: serde_json::Value = serde_json::from_str(&res.text().unwrap()).unwrap(); - Some(User::from_activity(conn, json, url.split("@").last().unwrap().to_string())) + Some(User::from_activity(conn, json, acct.split("@").last().unwrap().to_string())) }, Err(_) => None }