]> granicus.if.org Git - neomutt/commitdiff
imap: remove ImapMbox from imap_adata_find()
authorMehdi Abaakouk <sileht@sileht.net>
Tue, 13 Nov 2018 23:31:41 +0000 (00:31 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 15 Nov 2018 00:26:28 +0000 (00:26 +0000)
imap/util.c

index 8ce46c692227a5681c77779beb4c8849d48c4dee..c52f4f12e4ecbc4a262688cee3427d45012e347f 100644 (file)
@@ -129,10 +129,10 @@ struct ImapAccountData *imap_adata_get(struct Mailbox *m)
 struct ImapAccountData *imap_adata_find(const char *path, char *mailbox,
                                         size_t mailboxlen, bool fix_path)
 {
-  // NOTE(sileht): Remove mx when we are able to pass Mailbox or Url there.
-  struct ImapMbox mx;
+  struct ConnAccount conn_account;
+  char tmp[LONG_STRING];
 
-  if (imap_parse_path(path, &mx) < 0)
+  if (imap_parse_path2(path, &conn_account, tmp, sizeof(tmp)) < 0)
     return NULL;
 
   struct Account *np = NULL;
@@ -143,14 +143,14 @@ struct ImapAccountData *imap_adata_find(const char *path, char *mailbox,
       continue;
 
     adata = np->adata;
-    if (imap_account_match(&adata->conn_account, &mx.account))
+    if (imap_account_match(&adata->conn_account, &conn_account))
     {
-      if (mx.mbox)
+      if (tmp[0] != '\0')
       {
         if (fix_path)
-          imap_fix_path(adata, mx.mbox, mailbox, mailboxlen);
+          imap_fix_path(adata, tmp, mailbox, mailboxlen);
         else
-          mutt_str_strfcpy(mailbox, mx.mbox, mailboxlen);
+          mutt_str_strfcpy(mailbox, tmp, mailboxlen);
       }
       return adata;
     }