mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-06 03:50:08 +02:00
Merge pull request #181 from t-oster/feature-copy-delete-fallback
Fallback to Copy/Delete if Move not possible
This commit is contained in:
commit
23fa14640e
1 changed files with 17 additions and 3 deletions
20
src/mrimap.c
20
src/mrimap.c
|
@ -1732,9 +1732,23 @@ int mrimap_markseen_msg(mrimap_t* ths, const char* folder, uint32_t server_uid,
|
||||||
struct mailimap_set* res_setdest = NULL;
|
struct mailimap_set* res_setdest = NULL;
|
||||||
r = mailimap_uidplus_uid_move(ths->m_hEtpan, set, ths->m_moveto_folder, &res_uid, &res_setsrc, &res_setdest); /* the correct folder is already selected in add_flag__() above */
|
r = mailimap_uidplus_uid_move(ths->m_hEtpan, set, ths->m_moveto_folder, &res_uid, &res_setsrc, &res_setdest); /* the correct folder is already selected in add_flag__() above */
|
||||||
if( is_error(ths, r) ) {
|
if( is_error(ths, r) ) {
|
||||||
mrmailbox_log_info(ths->m_mailbox, 0, "Cannot move message.");
|
mrmailbox_log_info(ths->m_mailbox, 0, "Cannot move message, fallback to COPY/DELETE %s/%i to %s...", folder, (int)server_uid, ths->m_moveto_folder);
|
||||||
goto cleanup;
|
r = mailimap_uidplus_uid_copy(ths->m_hEtpan, set, ths->m_moveto_folder, &res_uid, &res_setsrc, &res_setdest);
|
||||||
}
|
if (is_error(ths, r)) {
|
||||||
|
mrmailbox_log_info(ths->m_mailbox, 0, "Cannot copy message. Leaving in INBOX");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mrmailbox_log_info(ths->m_mailbox, 0, "Deleting msg ...");
|
||||||
|
if( add_flag__(ths, server_uid, mailimap_flag_new_deleted())==0 ) {
|
||||||
|
mrmailbox_log_warning(ths->m_mailbox, 0, "Cannot mark message as \"Deleted\".");/* maybe the message is already deleted */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* force an EXPUNGE resp. CLOSE for the selected folder */
|
||||||
|
ths->m_selected_folder_needs_expunge = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if( res_setsrc ) {
|
if( res_setsrc ) {
|
||||||
mailimap_set_free(res_setsrc);
|
mailimap_set_free(res_setsrc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue