Fix fetch instance software version from nodeinfo (#3772)

Fixes #3771
pull/3791/head
Denis Dzyubenko 2023-08-01 10:55:28 +02:00 committed by GitHub
parent 6ed2ddf76d
commit 55e383ae38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -387,12 +387,13 @@ fn update_instance_software(conn: &mut PgConnection, user_agent: &str) -> LemmyR
Ok(res) => match res.json::<NodeInfo>() {
Ok(node_info) => {
// Instance sent valid nodeinfo, write it to db
let software = node_info.software.as_ref();
Some(
InstanceForm::builder()
.domain(instance.domain)
.updated(Some(naive_now()))
.software(node_info.software.and_then(|s| s.name))
.version(node_info.version.clone())
.software(software.and_then(|s| s.name.clone()))
.version(software.and_then(|s| s.version.clone()))
.build(),
)
}