Skip to content

Commit

Permalink
Merge pull request #201 from hoodie/renovate/zbus-4.x
Browse files Browse the repository at this point in the history
fix(deps): update rust crate zbus to v4
  • Loading branch information
hoodie authored Apr 4, 2024
2 parents 673925e + dce3f1d commit 79fbbc8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
rust:
- stable
- beta
- stable minus 6 releases
- stable minus 2 releases
feature:
- d
- d,images
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include = [
dbus = { version = "0.9", optional = true }
lazy_static = { version = "1", optional = true }
image = { version = "0.24", optional = true }
zbus = { version = "3.10", optional = true }
zbus = { version = "4.1", optional = true }
serde = { version = "1", optional = true }
log = "0.4"
env_logger ={ version ="0.10", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl Notification {
windows::show_notification(self)
}

/// Wraps `show()` but prints notification to stdout.
/// Wraps [`show()`] but prints notification to stdout.
#[cfg(all(unix, not(target_os = "macos")))]
#[deprecated = "this was never meant to be public API"]
pub fn show_debug(&mut self) -> Result<xdg::NotificationHandle> {
Expand Down
42 changes: 22 additions & 20 deletions src/xdg/zbus_rs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ async fn send_notification_via_connection_at_bus(
)
.await?
.body()
.deserialize()
.unwrap();
Ok(reply)
}
Expand Down Expand Up @@ -193,7 +194,8 @@ pub async fn get_capabilities_at_bus(bus: NotificationBus) -> Result<Vec<String>
&(),
)
.await?
.body()?;
.body()
.deserialize()?;
Ok(info)
}

Expand All @@ -212,7 +214,8 @@ pub async fn get_server_information_at_bus(bus: NotificationBus) -> Result<xdg::
&(),
)
.await?
.body()?;
.body()
.deserialize()?;

Ok(info)
}
Expand Down Expand Up @@ -255,29 +258,28 @@ async fn wait_for_action_signal(
proxy.add_match_rule(close_signal_rule).await.unwrap();

while let Ok(Some(msg)) = zbus::MessageStream::from(connection).try_next().await {
if let Ok(header) = msg.header() {
if let Ok(zbus::MessageType::Signal) = header.message_type() {
match header.member() {
Ok(Some(name)) if name == "ActionInvoked" => {
match msg.body::<(u32, String)>() {
Ok((nid, action)) if nid == id => {
handler.call(&ActionResponse::Custom(&action));
break;
}
_ => {}
let header = msg.header();
if let zbus::MessageType::Signal = header.message_type() {
match header.member() {
Some(name) if name == "ActionInvoked" => {
match msg.body().deserialize::<(u32, String)>() {
Ok((nid, action)) if nid == id => {
handler.call(&ActionResponse::Custom(&action));
break;
}
_ => {}
}
Ok(Some(name)) if name == "NotificationClosed" => {
match msg.body::<(u32, u32)>() {
Ok((nid, reason)) if nid == id => {
handler.call(&ActionResponse::Closed(reason.into()));
break;
}
_ => {}
}
Some(name) if name == "NotificationClosed" => {
match msg.body().deserialize::<(u32, u32)>() {
Ok((nid, reason)) if nid == id => {
handler.call(&ActionResponse::Closed(reason.into()));
break;
}
_ => {}
}
Ok(_) | Err(_) => {}
}
_ => {}
}
}
}
Expand Down

0 comments on commit 79fbbc8

Please sign in to comment.