Check for new groups/articles in subscribed groups.
2117{
2119 time_t now = 0;
2120 char buf[1024] = { 0 };
2121 char *msg =
_(
"Checking for new newsgroups...");
2122 unsigned int i;
2123 int rc;
2124 int update_active = false;
2125
2127 return -1;
2128
2129
2131 if (c_show_new_news)
2132 {
2135 {
2137
2139 {
2141 if (rc < 0)
2142 return -1;
2143 if (rc > 0)
2144 update_active = true;
2145 }
2146 }
2147 }
2149 {
2150 return 0;
2151 }
2152
2153
2156 return -1;
2160 else
2161 tmp_mdata.
group = NULL;
2164 snprintf(buf, sizeof(buf), "NEWGROUPS %02d%02d%02d %02d%02d%02d GMT\r\n",
2165 tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
2167 if (rc)
2168 {
2169 if (rc > 0)
2170 {
2172 }
2173 return -1;
2174 }
2175
2176
2177 rc = 0;
2179 {
2180 int groups_num = i;
2181
2184 {
2187 }
2188
2189
2191 if (c_nntp_load_description)
2192 {
2193 unsigned int count = 0;
2196
2197 for (i = groups_num; i < adata->
groups_num; i++)
2198 {
2200
2202 {
2204 return -1;
2205 }
2207 }
2209 }
2210 update_active = true;
2211 rc = 1;
2212 }
2213 if (update_active)
2216 return rc;
2217}
#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.
bool has_new_mail
Has new articles.