| #ifndef __DC_JOB_H__ |
| #define __DC_JOB_H__ |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
|
|
|
|
| |
| #define DC_IMAP_THREAD 100 |
| #define DC_SMTP_THREAD 5000 |
|
|
|
|
| |
| #define DC_JOB_HOUSEKEEPING 105 |
| #define DC_JOB_EMPTY_SERVER 107 |
| #define DC_JOB_DELETE_MSG_ON_IMAP 110 |
| #define DC_JOB_MARKSEEN_MDN_ON_IMAP 120 |
| #define DC_JOB_MARKSEEN_MSG_ON_IMAP 130 |
| #define DC_JOB_MOVE_MSG 200 |
| #define DC_JOB_CONFIGURE_IMAP 900 |
| #define DC_JOB_IMEX_IMAP 910 |
|
|
|
|
| |
| #define DC_JOB_MAYBE_SEND_LOCATIONS 5005 |
| #define DC_JOB_MAYBE_SEND_LOC_ENDED 5007 |
| #define DC_JOB_SEND_MDN_OLD 5010 |
| #define DC_JOB_SEND_MDN 5011 |
| #define DC_JOB_SEND_MSG_TO_SMTP_OLD 5900 |
| #define DC_JOB_SEND_MSG_TO_SMTP 5901 |
|
|
|
|
| |
| |
| |
| #define DC_IMAP_TIMEOUT_SEC 10 |
| #define DC_SMTP_TIMEOUT_SEC 10 |
|
|
|
|
| typedef struct _dc_job dc_job_t; |
|
|
| |
| |
| |
| struct _dc_job |
| { |
| |
|
|
| uint32_t job_id; |
| int action; |
| uint32_t foreign_id; |
| time_t desired_timestamp; |
| time_t added_timestamp; |
| int tries; |
| dc_param_t* param; |
|
|
| int try_again; |
| char* pending_error; |
| }; |
|
|
|
|
| void dc_job_add (dc_context_t*, int action, int foreign_id, const char* param, int delay); |
| int dc_job_action_exists (dc_context_t*, int action); |
| void dc_job_kill_action (dc_context_t*, int action); |
|
|
| int dc_job_send_msg (dc_context_t*, uint32_t msg_id); |
|
|
| #define DC_DONT_TRY_AGAIN 0 |
| #define DC_AT_ONCE -1 |
| #define DC_INCREATION_POLL 2 |
| #define DC_STANDARD_DELAY 3 |
| void dc_job_try_again_later (dc_job_t*, int try_again, const char* error); |
|
|
|
|
| |
| void dc_job_do_DC_JOB_CONFIGURE_IMAP (dc_context_t*, dc_job_t*); |
| void dc_job_do_DC_JOB_IMEX_IMAP (dc_context_t*, dc_job_t*); |
|
|
|
|
| #ifdef __cplusplus |
| } |
| #endif |
| #endif |
|
|
|
|