diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 77841a9..d04b84a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -79,6 +79,33 @@ Report bugs to https://github.com/gemrest/sydney/issues"#, let mut stdout = std::io::stdout(); + match germ::request::request( + &url::Url::parse("gemini://fuwn.me/api/sydney/version").unwrap(), + ) { + Ok(response) => + if let Some(content) = response.content() { + if content > &String::from(env!("CARGO_PKG_VERSION")) { + app.error = Some(format!( + "Your Sydney version ({}) is outdated. It is recommended that you \ + update to the newest version ({}).", + env!("CARGO_PKG_VERSION"), + content, + )); + } + } else { + app.error = Some( + "Could not check if Sydney has a newer version because the response \ + had no content. Please try again later." + .to_string(), + ); + }, + Err(error) => + app.error = Some(format!( + "Could not check if Sydney has a newer version: {}", + error + )), + } + execute!( stdout, terminal::EnterAlternateScreen, |