From: Karel Zak Date: Wed, 14 Dec 2011 13:26:45 +0000 (+0100) Subject: add context magic X-Git-Tag: neomutt-20160404~13^2~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf46370cbcb7353fe123a306c07f141d26a10d3b;p=neomutt add context magic Signed-off-by: Karel Zak --- diff --git a/mx.c b/mx.c index 4c49c6b10..b4d4dd7be 100644 --- a/mx.c +++ b/mx.c @@ -41,6 +41,10 @@ #include "pop.h" #endif +#ifdef USE_NOTMUCH +#include "mutt_notmuch.h" +#endif + #include "buffy.h" #ifdef USE_DOTLOCK @@ -346,6 +350,24 @@ int mx_is_pop (const char *p) } #endif +#ifdef USE_NOTMUCH + +int mx_is_notmuch(const char *p) +{ + url_scheme_t scheme; + + if (!p) + return 0; + + scheme = url_check_scheme (p); + if (scheme == U_NOTMUCH) + return 1; + + return 0; +} + +#endif + int mx_get_magic (const char *path) { struct stat st; diff --git a/mx.h b/mx.h index fc67a5002..a7a8ca07e 100644 --- a/mx.h +++ b/mx.h @@ -35,6 +35,7 @@ enum M_MH, M_MAILDIR, M_IMAP, + M_NOTMUCH, M_POP }; @@ -76,6 +77,10 @@ int mh_sync_mailbox_message (CONTEXT * ctx, int msgno, header_cache_t *hc); int mh_sync_mailbox_message (CONTEXT * ctx, int msgno); #endif +#ifdef USE_NOTMUCH +int mx_is_notmuch(const char *p); +#endif + int maildir_commit_message (CONTEXT *, MESSAGE *, HEADER *); int mh_commit_message (CONTEXT *, MESSAGE *, HEADER *);