mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
Refine type of Context.perform_inbox_jobs_needed to bool
This commit is contained in:
@@ -27,7 +27,7 @@ pub struct Context {
|
||||
pub blobdir: Arc<RwLock<*mut libc::c_char>>,
|
||||
pub sql: Sql,
|
||||
pub inbox: Arc<RwLock<Imap>>,
|
||||
pub perform_inbox_jobs_needed: Arc<RwLock<i32>>,
|
||||
pub perform_inbox_jobs_needed: Arc<RwLock<bool>>,
|
||||
pub probe_imap_network: Arc<RwLock<bool>>,
|
||||
pub sentbox_thread: Arc<RwLock<dc_jobthread_t>>,
|
||||
pub mvbox_thread: Arc<RwLock<dc_jobthread_t>>,
|
||||
@@ -161,7 +161,7 @@ pub fn dc_context_new(
|
||||
),
|
||||
))),
|
||||
probe_imap_network: Arc::new(RwLock::new(false)),
|
||||
perform_inbox_jobs_needed: Arc::new(RwLock::new(0)),
|
||||
perform_inbox_jobs_needed: Arc::new(RwLock::new(false)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ pub unsafe fn dc_perform_imap_jobs(context: &Context) {
|
||||
|
||||
let probe_imap_network = *context.probe_imap_network.clone().read().unwrap();
|
||||
*context.probe_imap_network.write().unwrap() = false;
|
||||
*context.perform_inbox_jobs_needed.write().unwrap() = 0;
|
||||
*context.perform_inbox_jobs_needed.write().unwrap() = false;
|
||||
|
||||
dc_job_perform(context, DC_IMAP_THREAD, probe_imap_network);
|
||||
info!(context, 0, "dc_perform_imap_jobs ended.",);
|
||||
@@ -859,7 +859,7 @@ pub unsafe fn dc_interrupt_smtp_idle(context: &Context) {
|
||||
pub unsafe fn dc_interrupt_imap_idle(context: &Context) {
|
||||
info!(context, 0, "Interrupting IMAP-IDLE...",);
|
||||
|
||||
*context.perform_inbox_jobs_needed.write().unwrap() = 1;
|
||||
*context.perform_inbox_jobs_needed.write().unwrap() = true;
|
||||
context.inbox.read().unwrap().interrupt_idle();
|
||||
}
|
||||
|
||||
@@ -967,7 +967,7 @@ pub fn dc_perform_imap_idle(context: &Context) {
|
||||
|
||||
connect_to_inbox(context, &inbox);
|
||||
|
||||
if 0 != *context.perform_inbox_jobs_needed.clone().read().unwrap() {
|
||||
if *context.perform_inbox_jobs_needed.clone().read().unwrap() {
|
||||
info!(
|
||||
context,
|
||||
0, "INBOX-IDLE will not be started because of waiting jobs."
|
||||
|
||||
Reference in New Issue
Block a user