projects
/
apps
/
madmutt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e6727ab
)
simplifications.
author
Pierre Habouzit
<madcoder@debian.org>
Mon, 28 May 2007 13:59:10 +0000
(15:59 +0200)
committer
Pierre Habouzit
<madcoder@debian.org>
Mon, 28 May 2007 13:59:10 +0000
(15:59 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
nntp.c
patch
|
blob
|
history
diff --git
a/nntp.c
b/nntp.c
index
52a5492
..
914df39
100644
(file)
--- a/
nntp.c
+++ b/
nntp.c
@@
-463,23
+463,6
@@
nntp_get_status(CONTEXT *ctx, HEADER *h, const char *group, int article)
h->old = 1;
}
h->old = 1;
}
-static void nntp_create_newsrc_line(nntp_data_t *data, buffer_t *buf)
-{
- buffer_addstr(buf, data->group);
- buffer_addch(buf, data->subscribed ? ':' : '!');
- buffer_addch(buf, ' ');
-
- for (int x = 0; x < data->num; x++) {
- if (x) {
- buffer_addch(buf, ',');
- }
-
- buffer_addf(buf, "%d-%d", data->entries[x].first,
- data->entries[x].last);
- }
- buffer_addch(buf, '\n');
-}
-
static void newsrc_gen_entries (CONTEXT * ctx)
{
nntp_data_t *data = (nntp_data_t *) ctx->data;
static void newsrc_gen_entries (CONTEXT * ctx)
{
nntp_data_t *data = (nntp_data_t *) ctx->data;
@@
-675,8
+658,18
@@
int mutt_newsrc_update (nntp_server_t * news)
for (data = news->list; data; data = data->next) {
if (!data || !data->rc)
continue;
for (data = news->list; data; data = data->next) {
if (!data || !data->rc)
continue;
- nntp_create_newsrc_line(data, &buf);
+
+ buffer_addstr(&buf, data->group);
+ buffer_addch(&buf, data->subscribed ? ':' : '!');
+
+ for (int x = 0; x < data->num; x++) {
+ buffer_addch(&buf, x ? ',' : ' ');
+ buffer_addf(&buf, "%d-%d", data->entries[x].first,
+ data->entries[x].last);
+ }
+ buffer_addch(&buf, '\n');
}
}
+
/* newrc being fully rewritten */
if (news->newsrc
&& (r = mutt_update_list_file(news->newsrc, NULL, "", buf.data)) == 0)
/* newrc being fully rewritten */
if (news->newsrc
&& (r = mutt_update_list_file(news->newsrc, NULL, "", buf.data)) == 0)
@@
-722,13
+715,12
@@
static int nntp_update_cacheindex (nntp_server_t * serv, nntp_data_t * data)
if (data && data->group) {
key = data->group;
if (data && data->group) {
key = data->group;
- snprintf (buf, sizeof (buf), "%s %s %d %d", key, data->cache,
- data->firstMessage, data->lastLoaded);
- }
- else {
+ snprintf(buf, sizeof(buf), "%s %s %d %d", key, data->cache,
+ data->firstMessage, data->lastLoaded);
+ } else {
m_strcpy(file, sizeof(file), serv->cache);
m_strcpy(file, sizeof(file), serv->cache);
- snprintf
(buf, sizeof (buf), "ALL %s 0 %d", file,
-
(int)
serv->newgroups_time);
+ snprintf(buf, sizeof (buf), "ALL %s 0 %d", file,
+
(int)
serv->newgroups_time);
}
nntp_cache_expand(file, ssizeof(file), "%s.index", serv->conn->account.host);
return mutt_update_list_file(file, serv->conn->account.host, key, buf);
}
nntp_cache_expand(file, ssizeof(file), "%s.index", serv->conn->account.host);
return mutt_update_list_file(file, serv->conn->account.host, key, buf);