}
#endif
#ifdef USE_NNTP
- if (mx_is_nntp(np->b->path))
+ if (nntp_path_probe(np->b->path, NULL) == MUTT_NNTP)
{
add_folder(menu, state, np->b->path, NULL, NULL, np->b, NULL);
continue;
if (!mx_is_pop(fname))
#endif
#ifdef USE_NNTP
- if (!mx_is_nntp(fname) && !OptNews)
+ if (!OptNews && (nntp_path_probe(fname, NULL) != MUTT_NNTP))
#endif
/* check to make sure the file exists and is readable */
if (access(fname, R_OK) == -1)
#ifdef USE_NOTMUCH
#include "notmuch/mutt_notmuch.h"
#endif
+#ifdef USE_NNTP
+#include "nntp/nntp.h"
+#endif
/* These Config Variables are only used in mailbox.c */
short MailCheck; ///< Config: Number of seconds before NeoMutt checks for new mail
else
#endif
#ifdef USE_NNTP
- if ((tmp->magic == MUTT_NNTP) || mx_is_nntp(tmp->path))
+ if ((tmp->magic == MUTT_NNTP) || (nntp_path_probe(tmp->path, NULL) == MUTT_NNTP))
tmp->magic = MUTT_NNTP;
#endif
#ifdef USE_NOTMUCH
skip |= mx_is_imap(fpath);
#endif
#ifdef USE_NNTP
- skip |= mx_is_nntp(fpath);
+ skip |= (nntp_path_probe(fpath, NULL) == MUTT_NNTP);
#endif
if (!skip && (stat(fpath, &sb) == -1) && (errno == ENOENT))
{
}
#endif
-#ifdef USE_NNTP
-/**
- * mx_is_nntp - Is this an NNTP mailbox
- * @param p Mailbox string to test
- * @retval true It is an NNTP mailbox
- */
-bool mx_is_nntp(const char *p)
-{
- enum UrlScheme scheme;
-
- if (!p)
- return false;
-
- scheme = url_check_scheme(p);
- if (scheme == U_NNTP || scheme == U_NNTPS)
- 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_NNTP
-bool mx_is_nntp(const char *p);
-#endif
#ifdef USE_POP
bool mx_is_pop(const char *p);
#endif
if (!path)
return MUTT_UNKNOWN;
- enum UrlScheme scheme = url_check_scheme(path);
- if ((scheme == U_NNTP) || (scheme == U_NNTPS))
- return MUTT_NNTP;
+ if (mutt_str_strncasecmp(path, "news://", 7) == 0)
+ return MUTT_NOTMUCH;
+
+ if (mutt_str_strncasecmp(path, "snews://", 8) == 0)
+ return MUTT_NOTMUCH;
return MUTT_UNKNOWN;
}