Check for new groups/articles in subscribed groups.
2105{
2107 time_t now = 0;
2108 char buf[1024] = { 0 };
2109 char *msg =
_(
"Checking for new newsgroups...");
2110 unsigned int i;
2111 int rc, update_active = false;
2112
2114 return -1;
2115
2116
2118 if (c_show_new_news)
2119 {
2122 {
2124
2126 {
2128 if (rc < 0)
2129 return -1;
2130 if (rc > 0)
2131 update_active = true;
2132 }
2133 }
2134 }
2136 {
2137 return 0;
2138 }
2139
2140
2143 return -1;
2147 else
2148 tmp_mdata.
group = NULL;
2151 snprintf(buf, sizeof(buf), "NEWGROUPS %02d%02d%02d %02d%02d%02d GMT\r\n",
2152 tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
2154 if (rc)
2155 {
2156 if (rc > 0)
2157 {
2159 }
2160 return -1;
2161 }
2162
2163
2164 rc = 0;
2166 {
2167 int groups_num = i;
2168
2171 {
2173 mdata->has_new_mail =
true;
2174 }
2175
2176
2178 if (c_nntp_load_description)
2179 {
2180 unsigned int count = 0;
2183
2184 for (i = groups_num; i < adata->
groups_num; i++)
2185 {
2187
2189 {
2191 return -1;
2192 }
2194 }
2196 }
2197 update_active = true;
2198 rc = 1;
2199 }
2200 if (update_active)
2203 return rc;
2204}
#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.