diff --git a/Cargo.lock b/Cargo.lock index 8a6c7a5..4b69bcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1800,7 +1800,7 @@ dependencies = [ [[package]] name = "notify" -version = "0.1.1" +version = "0.1.3" dependencies = [ "anyhow", "ashpd", diff --git a/Cargo.toml b/Cargo.toml index c557772..f9ff854 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "notify" -version = "0.1.1" +version = "0.1.3" authors = ["ranfdev "] edition = "2021" diff --git a/data/resources/com.ranfdev.Notify.metainfo.xml.in.in b/data/resources/com.ranfdev.Notify.metainfo.xml.in.in index 8207121..7514a66 100644 --- a/data/resources/com.ranfdev.Notify.metainfo.xml.in.in +++ b/data/resources/com.ranfdev.Notify.metainfo.xml.in.in @@ -26,6 +26,12 @@ + +
    +
  • Support for basic authentication with custom accounts
  • +
  • Custom server field is now prefilled when appropriate
  • +
+
  • Introduced dialog to write advanced messages
  • diff --git a/meson.build b/meson.build index 336a2fe..226e39c 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'notify', 'rust', - version: '0.1.2', + version: '0.1.3', meson_version: '>= 0.59', # license: 'MIT', ) diff --git a/ntfy-daemon/src/credentials.rs b/ntfy-daemon/src/credentials.rs index d11db09..c79879f 100644 --- a/ntfy-daemon/src/credentials.rs +++ b/ntfy-daemon/src/credentials.rs @@ -58,6 +58,13 @@ impl Credentials { self.creds.borrow().clone() } pub async fn insert(&self, server: &str, username: &str, password: &str) -> anyhow::Result<()> { + { + if let Some(cred) = self.creds.borrow().get(server) { + if cred.username != username { + anyhow::bail!("You can add only one account per server"); + } + } + } let attrs = HashMap::from([ ("type", "password"), ("username", username),