mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-19 00:26:32 +00:00
Save the correct instance URL in the database
This commit is contained in:
parent
8047df6848
commit
ce5c60bffe
1 changed files with 2 additions and 2 deletions
|
@ -106,7 +106,7 @@ impl User {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fetch_from_webfinger(conn: &PgConnection, acct: String) -> Option<User> {
|
fn fetch_from_webfinger(conn: &PgConnection, acct: String) -> Option<User> {
|
||||||
match resolve(acct) {
|
match resolve(acct.clone()) {
|
||||||
Ok(url) => {
|
Ok(url) => {
|
||||||
let req = Client::new()
|
let req = Client::new()
|
||||||
.get(&url[..])
|
.get(&url[..])
|
||||||
|
@ -115,7 +115,7 @@ impl User {
|
||||||
match req {
|
match req {
|
||||||
Ok(mut res) => {
|
Ok(mut res) => {
|
||||||
let json: serde_json::Value = serde_json::from_str(&res.text().unwrap()).unwrap();
|
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
|
Err(_) => None
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue