return 0;
}
+bool imapc_mailbox_name_equals(struct imapc_mailbox *mbox,
+ const char *remote_name)
+{
+ const char *imapc_remote_name =
+ imapc_mailbox_get_remote_name(mbox);
+
+ if (strcmp(imapc_remote_name, remote_name) == 0) {
+ /* match */
+ return TRUE;
+ } else if (strcasecmp(mbox->box.name, "INBOX") == 0 &&
+ strcasecmp(remote_name, "INBOX") == 0) {
+ /* case-insensitive INBOX */
+ return TRUE;
+ }
+ return FALSE;
+}
+
static void imapc_untagged_fetch(const struct imapc_untagged_reply *reply,
struct imapc_mailbox *mbox)
{
if (storage->cur_status_box == NULL)
return;
- const char *cur_status_remote_name =
- imapc_mailbox_get_remote_name(storage->cur_status_box);
- if (strcmp(cur_status_remote_name, remote_name) == 0) {
- /* match */
- } else if (strcasecmp(storage->cur_status_box->box.name, "INBOX") == 0 &&
- strcasecmp(remote_name, "INBOX") == 0) {
- /* case-insensitive INBOX */
- } else {
+ if (!imapc_mailbox_name_equals(storage->cur_status_box,
+ remote_name))
return;
- }
status = storage->cur_status;
for (i = 0; list[i].type != IMAP_ARG_EOL; i += 2) {
void *context);
int imapc_mailbox_commit_delayed_trans(struct imapc_mailbox *mbox,
bool force, bool *changes_r);
+bool imapc_mailbox_name_equals(struct imapc_mailbox *mbox,
+ const char *remote_name);
void imapc_mailbox_noop(struct imapc_mailbox *mbox);
void imapc_mailbox_set_corrupted(struct imapc_mailbox *mbox,
const char *reason, ...) ATTR_FORMAT(2, 3);