]> granicus.if.org Git - neomutt/commitdiff
probe pop
authorRichard Russon <rich@flatcap.org>
Sat, 25 Aug 2018 16:46:41 +0000 (17:46 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 26 Aug 2018 21:11:03 +0000 (22:11 +0100)
browser.c
compose.c
mailbox.c
mx.c
mx.h
pop/pop.c
pop/pop_private.h

index c0bf670eb37d61355b9b21b8a9653eea796228f9..a793194ecaad6d7b7891f8956a1558e85181eb32 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -66,6 +66,9 @@
 #ifdef USE_NOTMUCH
 #include "notmuch/mutt_notmuch.h"
 #endif
+#ifdef USE_POP
+#include "pop/pop.h"
+#endif
 
 /* These Config Variables are only used in browser.c */
 bool BrowserAbbreviateMailboxes; ///< Config: Abbreviate mailboxes using '~' and '=' in the browser
@@ -987,7 +990,7 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)
       }
 #endif
 #ifdef USE_POP
-      if (mx_is_pop(np->b->path))
+      if (pop_path_probe(np->b->path, NULL) == MUTT_POP)
       {
         add_folder(menu, state, buffer, NULL, NULL, np->b, NULL);
         continue;
index 5563e7e832e710f63f4b44e804a202b5cea80623..d0749cf40d19a1a0f0f59dd3fc0d8b2e429a660a 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -70,6 +70,9 @@
 #ifdef USE_NNTP
 #include "nntp/nntp.h"
 #endif
+#ifdef USE_POP
+#include "pop/pop.h"
+#endif
 
 /* These Config Variables are only used in compose.c */
 char *ComposeFormat; ///< Config: printf-like format string for the Compose panel's status bar
@@ -1431,7 +1434,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
         if (!mx_is_imap(fname))
 #endif
 #ifdef USE_POP
-          if (!mx_is_pop(fname))
+          if (pop_path_probe(fname, NULL) != MUTT_POP)
 #endif
 #ifdef USE_NNTP
             if (!OptNews && (nntp_path_probe(fname, NULL) != MUTT_NNTP))
index 2d35ca0939a879eb03284033c228888ae3ea0a18..19927a720be75d011748fca2c3751812adf37398 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -55,6 +55,9 @@
 #ifdef USE_NNTP
 #include "nntp/nntp.h"
 #endif
+#ifdef USE_POP
+#include "pop/pop.h"
+#endif
 
 /* These Config Variables are only used in mailbox.c */
 short MailCheck; ///< Config: Number of seconds before NeoMutt checks for new mail
@@ -397,7 +400,7 @@ static void mailbox_check(struct Mailbox *tmp, struct stat *contex_sb, bool chec
   {
     tmp->new = false;
 #ifdef USE_POP
-    if (mx_is_pop(tmp->path))
+    if (pop_path_probe(tmp->path, NULL) == MUTT_POP)
       tmp->magic = MUTT_POP;
     else
 #endif
diff --git a/mx.c b/mx.c
index 745c1859c8233b743e7dac3edffaca03f40522b1..1c7ecd20504d6ebdfc6d9f36f9bf5b924bc83ba7 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -171,27 +171,6 @@ bool mx_is_imap(const char *p)
 }
 #endif
 
-#ifdef USE_POP
-/**
- * mx_is_pop - Is this a POP mailbox
- * @param p Mailbox string to test
- * @retval true It is a POP mailbox
- */
-bool mx_is_pop(const char *p)
-{
-  enum UrlScheme scheme;
-
-  if (!p)
-    return false;
-
-  scheme = url_check_scheme(p);
-  if (scheme == U_POP || scheme == U_POPS)
-    return true;
-
-  return false;
-}
-#endif
-
 /**
  * mx_access - Wrapper for access, checks permissions on a given mailbox
  * @param path  Path of mailbox
diff --git a/mx.h b/mx.h
index d81d0999056b42465e2329f73496841bb797c048..ebc3f92a95534cd047ee33f21600165b01a465d2 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -255,8 +255,5 @@ void                mx_update_tables(struct Context *ctx, bool committing);
 #ifdef USE_IMAP
 bool mx_is_imap(const char *p);
 #endif
-#ifdef USE_POP
-bool mx_is_pop(const char *p);
-#endif
 
 #endif /* _MUTT_MX_H */
index d4a86217ea9b4a5ff38b69e8c410b8dac8103ac7..e25da70b96d07de3ebcb29e04f4d6c44847e7275 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -1064,9 +1064,11 @@ int pop_path_probe(const char *path, const struct stat *st)
   if (!path)
     return MUTT_UNKNOWN;
 
-  enum UrlScheme scheme = url_check_scheme(path);
-  if ((scheme == U_POP) || (scheme == U_POPS))
-    return MUTT_POP;
+  if (mutt_str_strncasecmp(path, "pop://", 6) == 0)
+    return MUTT_NOTMUCH;
+
+  if (mutt_str_strncasecmp(path, "pops://", 7) == 0)
+    return MUTT_NOTMUCH;
 
   return MUTT_UNKNOWN;
 }
index 65fda85b053545579134cccd60ce3fa32628150a..d054bdadfeb6352cf66232a750ceb2545268b69f 100644 (file)
@@ -124,5 +124,4 @@ int pop_fetch_data(struct PopData *pop_data, char *query, struct Progress *progr
 int pop_reconnect(struct Context *ctx);
 void pop_logout(struct Context *ctx);
 
-
 #endif /* _POP_PRIVATE_H */