Check for new groups/articles in subscribed groups.
2106{
2108 time_t now = 0;
2109 char buf[1024] = { 0 };
2110 char *msg =
_(
"Checking for new newsgroups...");
2111 unsigned int i;
2112 int rc, update_active = false;
2113
2115 return -1;
2116
2117
2119 if (c_show_new_news)
2120 {
2123 {
2125
2127 {
2129 if (rc < 0)
2130 return -1;
2131 if (rc > 0)
2132 update_active = true;
2133 }
2134 }
2135 }
2137 {
2138 return 0;
2139 }
2140
2141
2144 return -1;
2148 else
2149 tmp_mdata.
group = NULL;
2152 snprintf(buf, sizeof(buf), "NEWGROUPS %02d%02d%02d %02d%02d%02d GMT\r\n",
2153 tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
2155 if (rc)
2156 {
2157 if (rc > 0)
2158 {
2160 }
2161 return -1;
2162 }
2163
2164
2165 rc = 0;
2167 {
2168 int groups_num = i;
2169
2172 {
2174 mdata->has_new_mail =
true;
2175 }
2176
2177
2179 if (c_nntp_load_description)
2180 {
2181 unsigned int count = 0;
2184
2185 for (i = groups_num; i < adata->
groups_num; i++)
2186 {
2188
2190 {
2192 return -1;
2193 }
2195 }
2197 }
2198 update_active = true;
2199 rc = 1;
2200 }
2201 if (update_active)
2204 return rc;
2205}
#define mutt_message(...)
struct tm mutt_date_gmtime(time_t t)
Converts calendar time to a broken-down time structure expressed in UTC timezone.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
int nntp_add_group(char *line, void *data)
Parse newsgroup.
int nntp_active_save_cache(struct NntpAccountData *adata)
Save list of all newsgroups to cache.
static int nntp_date(struct NntpAccountData *adata, time_t *now)
Get date and time from server.
static int nntp_group_poll(struct NntpMboxData *mdata, bool update_stat)
Check newsgroup for new articles.
static int nntp_fetch_lines(struct NntpMboxData *mdata, char *query, size_t qlen, const char *msg, int(*func)(char *, void *), void *data)
Read lines, calling a callback function for each.
static int get_description(struct NntpMboxData *mdata, const char *wildmat, const char *msg)
Fetch newsgroups descriptions.
@ MUTT_PROGRESS_READ
Progress tracks elements, according to $read_inc
struct Progress * progress_new(enum ProgressType type, size_t size)
Create a new Progress Bar.
void progress_free(struct Progress **ptr)
Free a Progress Bar.
void progress_set_message(struct Progress *progress, const char *fmt,...) __attribute__((__format__(__printf__
bool progress_update(struct Progress *progress, size_t pos, int percent)
Update the state of the progress bar.