2396{
2400
2401 char buf[8192] = { 0 };
2402 char server[1024] = { 0 };
2403 char *group = NULL;
2404 int rc;
2409
2411 if (!url || !url->
host || !url->
path ||
2413 {
2417 }
2418
2420 if (group[0] == '/')
2421 group++;
2422
2423 url->
path = strchr(url->
path,
'\0');
2425
2431 {
2435 }
2436
2438 {
2441 }
2443
2447
2448 if (group[0] == '/')
2449 group++;
2450
2451
2454 {
2459 }
2460
2463 if (!
mdata->newsrc_ent && !
mdata->subscribed && !c_save_unsubscribed)
2465
2466
2469 buf[0] = '\0';
2471 {
2474 }
2475
2476
2478 {
2479 mutt_error(
_(
"Newsgroup %s has been removed from the server"),
mdata->group);
2480 if (!
mdata->deleted)
2481 {
2482 mdata->deleted =
true;
2484 }
2485 if (
mdata->newsrc_ent && !
mdata->subscribed && !c_save_unsubscribed)
2486 {
2488 mdata->newsrc_len = 0;
2491 }
2492 }
2493 else
2494 {
2495
2497 {
2501 }
2502 mdata->first_message = first;
2503 mdata->last_message = last;
2504 mdata->deleted =
false;
2505
2506
2508 if (c_nntp_load_description && !
mdata->desc)
2509 {
2511 {
2514 }
2517 }
2518 }
2519
2522
2523
2524
2525 if (!
mdata->bcache && (
mdata->newsrc_ent ||
mdata->subscribed || c_save_unsubscribed))
2527
2528
2529 first =
mdata->first_message;
2531 if (c_nntp_context && ((
mdata->last_message - first + 1) > c_nntp_context))
2532 first =
mdata->last_message - c_nntp_context + 1;
2533 mdata->last_loaded = first ? first - 1 : 0;
2534 count =
mdata->first_message;
2535 mdata->first_message = first;
2537 mdata->first_message = count;
2538#ifdef USE_HCACHE
2541#endif
2542 if (!hc)
2544
2547#ifdef USE_HCACHE
2549#endif
2550 if (rc < 0)
2555}
struct BodyCache * mutt_bcache_open(struct ConnAccount *account, const char *mailbox)
Open an Email-Body Cache.
long cs_subset_long(const struct ConfigSubset *sub, const char *name)
Get a long config item by name.
void nntp_adata_free(void **ptr)
Free the private Account data - Implements Account::adata_free() -.
void * mutt_hash_find(const struct HashTable *table, const char *strkey)
Find the HashElem data in a Hash Table element using a key.
void hcache_close(struct HeaderCache **ptr)
Multiplexor for StoreOps::close.
void exec_account_hook(const char *url)
Perform an account hook.
#define FREE(x)
Free memory and set the pointer to NULL.
@ MODULE_ID_NNTP
ModuleNntp, Nntp
time_t mutt_date_now(void)
Return the number of seconds since the Unix epoch.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
struct HeaderCache * nntp_hcache_open(struct NntpMboxData *mdata)
Open newsgroup hcache.
void nntp_delete_group_cache(struct NntpMboxData *mdata)
Remove hcache and bcache of newsgroup.
void nntp_hcache_update(struct NntpMboxData *mdata, struct HeaderCache *hc)
Remove stale cached headers.
int nntp_active_save_cache(struct NntpAccountData *adata)
Save list of all newsgroups to cache.
void nntp_bcache_update(struct NntpMboxData *mdata)
Remove stale cached messages.
void nntp_newsrc_close(struct NntpAccountData *adata)
Unlock and close .newsrc file.
int nntp_newsrc_update(struct NntpAccountData *adata)
Update .newsrc file.
struct NntpAccountData * nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock)
Open a connection to an NNTP server.
static int nntp_query(struct NntpMboxData *mdata, char *line, size_t linelen)
Send data from buffer and receive answer to same buffer.
static int get_description(struct NntpMboxData *mdata, const char *wildmat, const char *msg)
Fetch newsgroups descriptions.
static int nntp_fetch_headers(struct Mailbox *m, void *hc, anum_t first, anum_t last, bool restore)
Fetch headers.
void(* adata_free)(void **ptr)
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
NNTP-specific Account data -.
bool newsrc_modified
Newsrc file was modified.
struct HashTable * groups_hash
Hash Table: "newsgroup" -> NntpMboxData.
struct Connection * conn
Connection to NNTP Server.
time_t check_time
Last check time.
NNTP-specific Mailbox data -.
char * group
Name of newsgroup.
struct NntpAccountData * adata
Account data.
Nntp private Module data.
struct NntpAccountData * current_news_srv
Current NNTP news server.
A parsed URL proto://user:password@host:port/path?a=1&b=2.
enum UrlScheme scheme
Scheme, e.g. U_SMTPS.
struct Url * url_parse(const char *src)
Fill in Url.
void url_free(struct Url **ptr)
Free the contents of a URL.
int url_tostring(const struct Url *url, char *dest, size_t len, uint8_t flags)
Output the URL string for a given Url object.
@ U_NNTPS
Url is nntps://.
#define U_NONE
No flags are set for URL parsing.