Stop using Event callback return values

Since stock string callback has been deprecated, all event callbacks
return 0.

For compatibility, C declarations are not changed and FFI users are
expected to return 0 from their callbacks.
This commit is contained in:
Alexander Krotov
2019-12-22 00:41:04 +03:00
parent 47be879445
commit 8e0a29e9b5
7 changed files with 73 additions and 130 deletions

View File

@@ -16,21 +16,18 @@ use deltachat::job::{
};
use deltachat::Event;
fn cb(_ctx: &Context, event: Event) -> usize {
fn cb(_ctx: &Context, event: Event) {
print!("[{:?}]", event);
match event {
Event::ConfigureProgress(progress) => {
print!(" progress: {}\n", progress);
0
}
Event::Info(msg) | Event::Warning(msg) | Event::Error(msg) | Event::ErrorNetwork(msg) => {
print!(" {}\n", msg);
0
}
_ => {
print!("\n");
0
}
}
}