Skip to content

Commit 7866067

Browse files
committed
fix
1 parent b5b31d6 commit 7866067

File tree

7 files changed

+20
-33
lines changed

7 files changed

+20
-33
lines changed

build-aux/com.ranfdev.Notify.Devel.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "com.ranfdev.Notify.Devel",
33
"runtime": "org.gnome.Platform",
4-
"runtime-version": "master",
4+
"runtime-version": "45",
55
"sdk": "org.gnome.Sdk",
66
"sdk-extensions": [
77
"org.freedesktop.Sdk.Extension.rust-stable",
@@ -13,7 +13,6 @@
1313
"--share=network",
1414
"--socket=fallback-x11",
1515
"--socket=wayland",
16-
"--socket=session-bus",
1716
"--device=dri",
1817
"--env=RUST_LOG=notify=debug,ntfy_daemon=debug",
1918
"--env=G_MESSAGES_DEBUG=none",

data/com.ranfdev.Notify.metainfo.xml.in.in

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,28 @@
44
<id>@app-id@</id>
55
<metadata_license>CC0</metadata_license>
66
<!-- Insert your license of choice here -->
7-
<!-- <project_license>MIT</project_license> -->
7+
<project_license>GPL-3.0-or-later</project_license>
88
<name>Notify</name>
9-
<summary>Write a GTK + Rust application</summary>
9+
<summary>Receive notifications from ntfy.sh.</summary>
1010
<description>
11-
<p>A boilerplate template for GTK + Rust. It uses Meson as a build system and has flatpak support by default.</p>
11+
<p>Versatile GTK4 client designed to seamlessly interface with the ntfy.sh notification service</p>
1212
</description>
1313
<screenshots>
1414
<screenshot type="default">
15-
<image>https://gitlab.gnome.org/bilelmoussaoui/notify/raw/master/data/resources/screenshots/screenshot1.png</image>
16-
<caption>Main window</caption>
15+
<image>https://raw.githubusercontent.com/ranfdev/Notify/main/data/screenshots/1.png</image>
16+
<caption>Main window, welcome screen</caption>
17+
</screenshot>
18+
<screenshot>
19+
<image>https://raw.githubusercontent.com/ranfdev/Notify/main/data/screenshots/2.png</image>
20+
<caption>Main window, subscription view</caption>
1721
</screenshot>
1822
</screenshots>
19-
<url type="homepage">https://gitlab.gnome.org/bilelmoussaoui/notify</url>
20-
<url type="bugtracker">https://gitlab.gnome.org/bilelmoussaoui/notify/issues</url>
23+
<url type="homepage">https://github.com/ranfdev/Notify</url>
24+
<url type="bugtracker">https://github.com/ranfdev/Notify/issues</url>
2125
<content_rating type="oars-1.0" />
2226
<releases>
23-
<release version="0.1.0" date="2019-07-11" />
27+
<release version="0.1.0" date="2023-10-13" />
2428
</releases>
25-
<kudos>
26-
<!--
27-
GNOME Software kudos:
28-
https://gitlab.gnome.org/GNOME/gnome-software/-/blob/main/doc/kudos.md
29-
-->
30-
<kudo>ModernToolkit</kudo>
31-
<kudo>HiDpiIcon</kudo>
32-
</kudos>
3329
<developer_name>ranfdev</developer_name>
3430
<update_contact>[email protected]</update_contact>
3531
<translation type="gettext">@gettext-package@</translation>

data/screenshots/1.png

25.7 KB
Loading

data/screenshots/2.png

65.6 KB
Loading

ntfy-daemon/src/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn emoji_map() -> &'static HashMap<String, String> {
1515
}
1616

1717
fn validate_topic(topic: &str) -> Result<&str, Error> {
18-
let re = Regex::new(r"^([A-z]|[0-9]|_)+$").unwrap();
18+
let re = Regex::new(r"^\w+$").unwrap();
1919
if re.is_match(topic) {
2020
Ok(topic)
2121
} else {

src/application.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
use std::path::Path;
2+
13
use adw::subclass::prelude::*;
24
use capnp_rpc::{rpc_twoparty_capnp, twoparty, RpcSystem};
3-
use futures::{AsyncRead, AsyncReadExt, AsyncWrite};
5+
use futures::AsyncReadExt;
46
use gettextrs::gettext;
57
use gio::SocketClient;
68
use gio::UnixSocketAddress;
@@ -12,9 +14,6 @@ use tracing::{debug, info};
1214
use crate::config::{APP_ID, PKGDATADIR, PROFILE, VERSION};
1315
use crate::widgets::*;
1416

15-
trait RW: AsyncRead + AsyncWrite {}
16-
impl<T: AsyncRead + AsyncWrite> RW for T {}
17-
1817
mod imp {
1918
use std::cell::RefCell;
2019

@@ -184,7 +183,8 @@ impl NotifyApplication {
184183
fn ensure_rpc_running(&self, socket_path: &Path) {
185184
let dbpath = glib::user_data_dir().join("com.ranfdev.Notify.sqlite");
186185
info!(database_path = %dbpath.display());
187-
ntfy_daemon::system_client::start(socket.to_owned(), dbpath.to_str().unwrap()).unwrap();
186+
ntfy_daemon::system_client::start(socket_path.to_owned(), dbpath.to_str().unwrap())
187+
.unwrap();
188188
self.imp().hold_guard.set(self.hold()).unwrap();
189189
}
190190

src/subscription.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ use std::rc::Rc;
44
use adw::prelude::*;
55
use capnp::capability::Promise;
66
use capnp_rpc::pry;
7-
use glib::once_cell::sync::Lazy;
87
use glib::subclass::prelude::*;
9-
use glib::subclass::Signal;
108
use glib::Properties;
119
use gtk::{gio, glib};
1210
use ntfy_daemon::models;
@@ -108,13 +106,7 @@ mod imp {
108106
}
109107

110108
#[glib::derived_properties]
111-
impl ObjectImpl for Subscription {
112-
fn signals() -> &'static [Signal] {
113-
static SIGNALS: Lazy<Vec<Signal>> =
114-
Lazy::new(|| vec![Signal::builder("awarded").build()]);
115-
SIGNALS.as_ref()
116-
}
117-
}
109+
impl ObjectImpl for Subscription {}
118110

119111
#[glib::object_subclass]
120112
impl ObjectSubclass for Subscription {

0 commit comments

Comments
 (0)