* please see the file GPL in the top level source directory.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/macros.h>
+#include <lib-lib/lib-lib.h>
#include <lib-mime/mime.h>
-
#include <lib-ui/curses.h>
+#include <lib-ui/sidebar.h>
+#include <lib-mx/mx.h>
#include "mutt.h"
#include "sort.h"
-#include "mx.h"
-#include "mx_nntp.h"
#include "nntp.h"
-#include "sidebar.h"
#include "buffy.h"
#include <lib-crypt/crypt.h>
-
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-
#define WANT_LISTGROUP_COMMAND 0
static unsigned int _checked = 0;
BUFFY* tmp = NULL;
char buf[STRING];
- if (list_empty (Incoming))
+ if (!Incoming.len)
return;
/* unfortunately, NNTP_DATA::group only is the plain
if ((i = buffy_lookup (buf)) < 0)
return;
- tmp = (BUFFY*) Incoming->data[i];
+ tmp = Incoming.arr[i];
/* copied from browser.c */
if (option (OPTMARKOLD) &&
data->lastCached >= data->firstMessage &&
/*
* currently, nntp "mailbox" is "newsgroup"
*/
-int nntp_open_mailbox (CONTEXT * ctx)
+static int nntp_open_mailbox (CONTEXT * ctx)
{
NNTP_DATA *nntp_data;
NNTP_SERVER *serv;
p_delete(&data);
}
-int nntp_sync_mailbox (CONTEXT * ctx, int unused1, int* unused2)
+static int nntp_sync_mailbox (CONTEXT * ctx, int unused1, int* unused2)
{
NNTP_DATA *data = ctx->data;
return 0;
}
-void nntp_fastclose_mailbox (CONTEXT * ctx)
+static void nntp_fastclose_mailbox (CONTEXT * ctx)
{
NNTP_DATA *data = (NNTP_DATA *) ctx->data, *tmp;
return 0;
}
-int nntp_check_mailbox (CONTEXT * ctx, int* unused1, int unused2)
+static int nntp_check_mailbox (CONTEXT * ctx, int* unused1, int unused2)
{
return _nntp_check_mailbox (ctx, (NNTP_DATA *) ctx->data);
}
if (l->data && ((NNTP_DATA *) l->data)->subscribed)
_nntp_check_mailbox (NULL, (NNTP_DATA *) l->data);
}
- sidebar_draw (CurrentMenu);
+ sidebar_draw ();
}
else if (!force)
return 0;
p_delete(&cc.child);
return ret;
}
+
+static int nntp_is_magic (const char* path, struct stat* st) {
+ url_scheme_t s = url_check_scheme (NONULL (path));
+ return ((s == U_NNTP || s == U_NNTPS) ? M_NNTP : -1);
+}
+
+static int acl_check_nntp (CONTEXT* ctx, int bit) {
+ switch (bit) {
+ case ACL_INSERT: /* editing messages */
+ case ACL_WRITE: /* change importance */
+ return (0);
+ case ACL_DELETE: /* (un)deletion */
+ case ACL_SEEN: /* mark as read */
+ return (1);
+ default:
+ return (0);
+ }
+}
+
+mx_t const nntp_mx = {
+ M_NNTP,
+ 0,
+ nntp_is_magic,
+ NULL,
+ NULL,
+ nntp_open_mailbox,
+ NULL,
+ acl_check_nntp,
+ nntp_check_mailbox,
+ nntp_fastclose_mailbox,
+ nntp_sync_mailbox,
+ NULL,
+};