aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/nntp/camel-nntp-summary.c
diff options
context:
space:
mode:
authorMeilof Veeningen <meilof@wanadoo.nl>2004-01-13 06:20:40 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-01-13 06:20:40 +0800
commit70f49bc0d7ce40521c4c99b7c9dbe6255db2c788 (patch)
tree6a1cd1a9114c3cb5d64dfe10c6fd08f39e853b03 /camel/providers/nntp/camel-nntp-summary.c
parentfb0dddb43d9b8a502c6c32dc10e6e485f35bec74 (diff)
downloadgsoc2013-evolution-70f49bc0d7ce40521c4c99b7c9dbe6255db2c788.tar
gsoc2013-evolution-70f49bc0d7ce40521c4c99b7c9dbe6255db2c788.tar.gz
gsoc2013-evolution-70f49bc0d7ce40521c4c99b7c9dbe6255db2c788.tar.bz2
gsoc2013-evolution-70f49bc0d7ce40521c4c99b7c9dbe6255db2c788.tar.lz
gsoc2013-evolution-70f49bc0d7ce40521c4c99b7c9dbe6255db2c788.tar.xz
gsoc2013-evolution-70f49bc0d7ce40521c4c99b7c9dbe6255db2c788.tar.zst
gsoc2013-evolution-70f49bc0d7ce40521c4c99b7c9dbe6255db2c788.zip
now based on discofolder, cache_message and append_message implemented,
2004-01-12 Meilof Veeningen <meilof@wanadoo.nl> * providers/nntp/camel-nntp-folder.[ch]: now based on discofolder, cache_message and append_message implemented, only retrieve messages when we are subscribed, some stubs * providers/nntp/camel-nntp-provider.c: newsgroup name display settings, password authentication, fix for check_equal where the protocols wouldn't be checked * providers/nntp/camel-nntp-store.[ch]: base on discostore with online/offline support, subscriptions, downloading changed parts of the newsgroup list, some stubs, authentication, automatic reconnect * providers/nntp/camel-nntp-store-summary.[ch]: NNTP store summary based on IMAP code * providers/nntp/camel-nntp-summary.c: save summary after xover * providers/nntp/camel-nntp-grouplist.h: added CamelNNTPGroupList structs * providers/nntp/Makefile.am: added store summary svn path=/trunk/; revision=24178
Diffstat (limited to 'camel/providers/nntp/camel-nntp-summary.c')
-rw-r--r--camel/providers/nntp/camel-nntp-summary.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index 2a9669d697..2fa753bef1 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -155,12 +155,12 @@ camel_nntp_summary_new(CamelNNTPFolder *folder)
char *path;
cns->folder = folder;
- path = g_strdup_printf("%s.ev-summary", folder->storage_path);
+ path = g_strdup_printf ("%s%s", folder->storage_path, ".ev-summary");
camel_folder_summary_set_filename((CamelFolderSummary *)cns, path);
g_free(path);
camel_folder_summary_set_build_content((CamelFolderSummary *)cns, FALSE);
-
+
return cns;
}
@@ -224,8 +224,11 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *changes,
unsigned int n, f, l;
int count;
- if (xover_setup(cns, ex) == -1)
+ if (xover_setup (cns, ex) == -1) {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
+ _("Connection error: %s"), strerror(errno));
return -1;
+ }
folder = (CamelFolder *)cns->folder;
store = (CamelNNTPStore *)folder->parent_store;
@@ -237,6 +240,8 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *changes,
_("No such folder: %s"), line);
return -1;
} else if (ret != 211) {
+ if (ret < 0)
+ line = "";
camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
_("Could not get group: %s"), line);
return -1;
@@ -247,9 +252,6 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *changes,
f = strtoul(line, &line, 10);
l = strtoul(line, &line, 10);
- dd(printf("nntp_summary: got last '%u' first '%u'\n"
- "nntp_summary: high '%u' low '%u'\n", l, f, cns->high, cns->low));
-
if (cns->low == f && cns->high == l) {
dd(printf("nntp_summary: no work to do!\n"));
return 0;
@@ -299,7 +301,14 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelFolderChangeInfo *changes,
}
}
+
+ /* TODO: not from here */
camel_folder_summary_touch(s);
+ camel_folder_summary_save(s);
+
+ if (ret < 0)
+ camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
+ _("Could not get messages: unspecificed error"));
return ret;
}
@@ -527,7 +536,8 @@ add_range_head(CamelNNTPSummary *cns, unsigned int high, unsigned int low, Camel
n = strtoul(line, &line, 10);
if (n != i)
g_warning("retrieved message '%d' when i expected '%d'?\n", n, i);
-
+
+ /* FIXME: use camel-mime-utils.c function for parsing msgid? */
if ((msgid = strchr(line, '<')) && (line = strchr(msgid+1, '>'))){
line[1] = 0;
cns->priv->uid = g_strdup_printf("%u,%s\n", n, msgid);