]> granicus.if.org Git - neomutt/commitdiff
add context magic
authorKarel Zak <kzak@redhat.com>
Wed, 14 Dec 2011 13:26:45 +0000 (14:26 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 14 Mar 2016 23:11:40 +0000 (23:11 +0000)
Signed-off-by: Karel Zak <kzak@redhat.com>
mx.c
mx.h

diff --git a/mx.c b/mx.c
index fa91812a83b248b7f25b66361b835c52aef6844a..3e26b8e3f7ee3fac6bd94741873876f93e78c7d4 100644 (file)
--- a/mx.c
+++ b/mx.c
 #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 754be41fd2a732a9a9823053c20df7cabdadbb39..e841fd4738a8df38ebfe1e4c7e797d489d33688c 100644 (file)
--- 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 *);