Replace numbers with named constants

This commit is contained in:
Dmitry Bogatov
2019-09-17 15:24:53 +00:00
parent 5001a0e37d
commit 391a6bf422
2 changed files with 8 additions and 9 deletions

View File

@@ -19,10 +19,10 @@ use crate::param::Params;
const DC_IMAP_SEEN: usize = 0x0001;
const DC_SUCCESS: usize = 3;
const DC_ALREADY_DONE: usize = 2;
const DC_RETRY_LATER: usize = 1;
const DC_FAILED: usize = 0;
pub const DC_SUCCESS: usize = 3;
pub const DC_ALREADY_DONE: usize = 2;
pub const DC_RETRY_LATER: usize = 1;
pub const DC_FAILED: usize = 0;
const PREFETCH_FLAGS: &str = "(UID ENVELOPE)";
const BODY_FLAGS: &str = "(FLAGS BODY.PEEK[])";

View File

@@ -246,15 +246,14 @@ impl Job {
msg.server_uid,
&dest_folder,
&mut dest_uid,
) as libc::c_uint
{
1 => {
) {
DC_RETRY_LATER => {
self.try_again_later(3i32, None);
}
3 => {
DC_SUCCESS => {
dc_update_server_uid(context, &msg.rfc724_mid, &dest_folder, dest_uid);
}
0 | 2 | _ => {}
DC_FAILED | DC_ALREADY_DONE | _ => {}
}
}
}