Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
Cargo.lock
5 changes: 4 additions & 1 deletion src/bin/notification-proxy-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl Server {
// Ignored. We pass an empty string.
_app_name: &str,
replaces_id: u32,
_app_icon: String,
app_icon: String,
summary: String,
body: String,
actions: Vec<String>,
Expand All @@ -119,6 +119,9 @@ impl Server {
let mut urgency = None;
let mut resident = false;
let mut category = None;
if !app_icon.is_empty() {
eprintln!("app_icon parameter is not yet supported")
}
for (i, j) in hints.into_iter() {
match &*i {
"action-icons" => {}
Expand Down
14 changes: 4 additions & 10 deletions src/bin/notification-proxy-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,10 @@ async fn client_server(qube_name: String) {
.expect("Cannot read reply")
.to_le();
let (reply_major, reply_minor) = notification_emitter::split_version(reply_version);
if reply_major != MAJOR_VERSION {
if reply_major != MAJOR_VERSION || reply_minor > MINOR_VERSION {
panic!(
"Version mismatch: client supports version {reply_major} \
but the version supported by this server is {MAJOR_VERSION}"
);
}
if reply_minor > MINOR_VERSION {
panic!(
"Version mismatch: client supports version {reply_minor} \
but this server only supports version {MINOR_VERSION}"
"Version mismatch: client supports version {reply_major}.{reply_minor} \
but this server only supports version {MAJOR_VERSION}.{MINOR_VERSION}"
);
}
let stdout = MessageWriter::new();
Expand Down Expand Up @@ -164,7 +158,7 @@ but this server only supports version {MINOR_VERSION}"
}
})
.expect("Serialization failed?");
stdout.transmit(&*data).await
stdout.transmit(&*data).await;
});
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ pub enum Urgency {
}

pub const MAX_SIZE: usize = 1usize << 21; // This is 2MiB, more than enough
pub const MAX_WIDTH: i32 = 255;
pub const MAX_HEIGHT: i32 = 255;
pub const MAX_WIDTH: i32 = 256;
pub const MAX_HEIGHT: i32 = 256;

pub const MAJOR_VERSION: u16 = 1;
pub const MINOR_VERSION: u16 = 0;
Expand Down Expand Up @@ -630,15 +630,15 @@ impl NotificationEmitter {
// sanitize end
hints.insert("category", Value::from(category));
}
// Temporarily disabled due to lack of image processing
if false {
// Temporarily enable to work on image processing
// if false {
if let Some(image) = image {
match serialize_image(image) {
Ok(value) => hints.insert("image-data", value),
Err(e) => return Err(zbus::Error::MissingParameter(e)),
};
}
}
// }
let mut escaped_body;
if self.body_markup() {
let body = sanitize_str(&*untrusted_body);
Expand Down