char *s = NULL;
#ifdef USE_NOTMUCH
- if (mx_is_notmuch(folder->ff->name))
+ if (nm_path_probe(folder->ff->name, NULL) == MUTT_NOTMUCH)
s = NONULL(folder->ff->desc);
else
#endif
struct MailboxNode *np = NULL;
STAILQ_FOREACH(np, &AllMailboxes, entries)
{
- if (mx_is_notmuch(np->b->path))
+ if (nm_path_probe(np->b->path, NULL) == MUTT_NOTMUCH)
{
nm_nonctx_get_count(np->b->path, &np->b->msg_count, &np->b->msg_unread);
add_folder(menu, state, np->b->path, np->b->desc, NULL, np->b, NULL);
mutt_str_strfcpy(file, state.entry[menu->current].name, filelen);
#endif
#ifdef USE_NOTMUCH
- else if (mx_is_notmuch(state.entry[menu->current].name))
+ else if (nm_path_probe(state.entry[menu->current].name, NULL) == MUTT_NOTMUCH)
mutt_str_strfcpy(file, state.entry[menu->current].name, filelen);
#endif
else
tmp->magic = MUTT_NNTP;
#endif
#ifdef USE_NOTMUCH
- if (mx_is_notmuch(tmp->path))
+ if (nm_path_probe(tmp->path, NULL) == MUTT_NOTMUCH)
tmp->magic = MUTT_NOTMUCH;
else
#endif
mutt_extract_token(path, s, 0);
#ifdef USE_NOTMUCH
- if (mx_is_notmuch(path->data))
+ if (nm_path_probe(path->data, NULL) == MUTT_NOTMUCH)
nm_normalize_uri(path->data, buf, sizeof(buf));
else
#endif
b->newly_created = false;
b->desc = desc;
#ifdef USE_NOTMUCH
- if (mx_is_notmuch(b->path))
+ if (nm_path_probe(b->path, NULL) == MUTT_NOTMUCH)
{
b->magic = MUTT_NOTMUCH;
b->size = 0;
else
{
#ifdef USE_NOTMUCH
- if (mx_is_notmuch(path->data))
+ if (nm_path_probe(path->data, NULL) == MUTT_NOTMUCH)
{
nm_normalize_uri(path->data, buf, sizeof(buf));
}
#ifdef USE_IMAP
#include "imap/imap.h"
#endif
+#ifdef USE_NOTMUCH
+#include "notmuch/mutt_notmuch.h"
+#endif
/* These Config Variables are only used in muttlib.c */
struct Regex *GecosMask; ///< Config: Regex for parsing GECOS field of /etc/passwd
else
#endif
#ifdef USE_NOTMUCH
- if (mx_is_notmuch(Folder))
+ if (nm_path_probe(Folder, NULL) == MUTT_NOTMUCH)
mutt_str_strfcpy(p, Folder, sizeof(p));
else
#endif
else
#endif
#ifdef USE_NOTMUCH
- if (mx_is_notmuch(path))
+ if (nm_path_probe(path, NULL) == MUTT_NOTMUCH)
mutt_str_strfcpy(buf, Folder, buflen);
else
#endif
}
#endif
-#ifdef USE_NOTMUCH
-/**
- * mx_is_notmuch - Is this a Notmuch mailbox
- * @param p Mailbox string to test
- * @retval true It is a Notmuch mailbox
- */
-bool mx_is_notmuch(const char *p)
-{
- enum UrlScheme scheme;
-
- if (!p)
- return false;
-
- scheme = url_check_scheme(p);
- if (scheme == U_NOTMUCH)
- return true;
-
- return false;
-}
-#endif
-
/**
* mx_access - Wrapper for access, checks permissions on a given mailbox
* @param path Path of mailbox
#ifdef USE_IMAP
bool mx_is_imap(const char *p);
#endif
-#ifdef USE_NOTMUCH
-bool mx_is_notmuch(const char *p);
-#endif
#ifdef USE_NNTP
bool mx_is_nntp(const char *p);
#endif
if (!path)
return MUTT_UNKNOWN;
- enum UrlScheme scheme = url_check_scheme(path);
- if (scheme == U_NOTMUCH)
+ if (mutt_str_strncasecmp(path, "notmuch://", 10) == 0)
return MUTT_NOTMUCH;
return MUTT_UNKNOWN;