2 * This file is part of mutt-ng, see http://www.muttng.org/.
3 * It's licensed under the GNU General Public License,
4 * please see the file GPL in the top level source directory.
12 #include <lib-lib/mem.h>
13 #include <lib-lib/str.h>
14 #include <lib-lib/url.h>
24 static int nntp_is_magic (const char* path, struct stat* st) {
25 url_scheme_t s = url_check_scheme (NONULL (path));
26 return ((s == U_NNTP || s == U_NNTPS) ? M_NNTP : -1);
29 static int acl_check_nntp (CONTEXT* ctx, int bit) {
31 case ACL_INSERT: /* editing messages */
32 case ACL_WRITE: /* change importance */
34 case ACL_DELETE: /* (un)deletion */
35 case ACL_SEEN: /* mark as read */
42 /* called by nntp_init(); don't call elsewhere */
43 mx_t* nntp_reg_mx (void) {
44 mx_t* fmt = p_new(mx_t, 1);
46 /* make up mx_t record... */
48 fmt->mx_is_magic = nntp_is_magic;
49 fmt->mx_open_mailbox = nntp_open_mailbox;
50 fmt->mx_acl_check = acl_check_nntp;
51 fmt->mx_fastclose_mailbox = nntp_fastclose_mailbox;
52 fmt->mx_sync_mailbox = nntp_sync_mailbox;
53 fmt->mx_check_mailbox = nntp_check_mailbox;