not checking mail folder sync error when LIST command's result callback is called. 46/94146/4
authorSan Cho <san.cho@samsung.com>
Mon, 27 Jun 2016 10:16:03 +0000 (19:16 +0900)
committerintae jeon <intae.jeon@samsung.com>
Fri, 28 Oct 2016 07:17:22 +0000 (00:17 -0700)
[Problem] the mails of INBOX was removed suddendly.
[Cause & Measure] Cause: mail folder sync operation is operated quite often.
But if there is a unexpected error in the folder sync time, we are guessing that not synced folder yet (because of network error) may be removed on mail server. so we are removing it from local db.

Change-Id: I33c2af6afd2956cfd188d5d0f6fc2df0dbb0ddaa
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
email-core/email-core-imap-mailbox.c

index c5fa364..c1349bf 100755 (executable)
@@ -741,9 +741,22 @@ int emcore_download_mailbox_list(void *mail_stream,
                ret = false;
        } else {
                ret = true;
-       }
-
 
+               /* checking once more if there is a INBOX or not */
+               int i = 0;
+               bool is_found_inbox = false;
+               for (i = 0; i < *count; i++) {
+                       if ((*mailbox_list)[i].mailbox_type == EMAIL_MAILBOX_TYPE_INBOX || !g_ascii_strcasecmp((*mailbox_list)[i].mailbox_name, "INBOX")) {
+                               is_found_inbox = true;
+                               break;
+                       }
+               }
+               if (!is_found_inbox) {
+                       EM_DEBUG_CRITICAL_EXCEPTION("There is no INBOX!");
+                       err = EMAIL_ERROR_MAILBOX_NOT_FOUND;
+                       ret = false;
+               }
+       }
 
 FINISH_OFF:
        if (err_code)