aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/nntp/camel-nntp-store.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-30 05:28:46 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-30 05:28:46 +0800
commitda570c66609a9baea34d4899c4ca7e1f8329d471 (patch)
tree78f82074f39463fc8db0cfb92728d57fe9c2ac84 /camel/providers/nntp/camel-nntp-store.c
parentba2eaa68b17882b0fec2eac160f674d29598795f (diff)
downloadgsoc2013-evolution-da570c66609a9baea34d4899c4ca7e1f8329d471.tar.gz
gsoc2013-evolution-da570c66609a9baea34d4899c4ca7e1f8329d471.tar.zst
gsoc2013-evolution-da570c66609a9baea34d4899c4ca7e1f8329d471.zip
CamelRemoteStore: a new generic store for stores that connect to servers. Prepare for the ability to cancel operations (much better exception handling). Clean up IMAP like nobody's business
svn path=/trunk/; revision=5103
Diffstat (limited to 'camel/providers/nntp/camel-nntp-store.c')
-rw-r--r--camel/providers/nntp/camel-nntp-store.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index c412c0f6a3..5c9475ed14 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -176,6 +176,8 @@ nntp_store_get_folder (CamelStore *store, const gchar *folder_name,
CF_CLASS (new_folder)->init (new_folder, store, NULL,
folder_name, ".", FALSE, ex);
+ CF_CLASS (new_folder)->refresh_info (new_folder, ex);
+
return new_folder;
}
@@ -271,21 +273,22 @@ camel_nntp_command (CamelNNTPStore *store, char **ret, char *fmt, ...)
va_list ap;
int status;
int resp_code;
- CamelException *ex;
va_start (ap, fmt);
cmdbuf = g_strdup_vprintf (fmt, ap);
va_end (ap);
- ex = camel_exception_new();
-
/* make sure we're connected */
- if (store->ostream == NULL)
- nntp_store_connect (CAMEL_SERVICE (store), ex);
-
- if (camel_exception_get_id (ex)) {
- camel_exception_free (ex);
- return CAMEL_NNTP_FAIL;
+ if (store->ostream == NULL) {
+ CamelException ex;
+
+ camel_exception_init (&ex);
+ nntp_store_connect (CAMEL_SERVICE (store), &ex);
+ if (camel_exception_get_id (&ex)) {
+ camel_exception_clear (&ex);
+ return CAMEL_NNTP_FAIL;
+ }
+ camel_exception_clear (&ex);
}
/* Send the command */
@@ -344,6 +347,19 @@ camel_nntp_command_get_additional_data (CamelNNTPStore *store)
char *buf;
int i, status = CAMEL_NNTP_OK;
+ /* make sure we're connected */
+ if (store->ostream == NULL) {
+ CamelException ex;
+
+ camel_exception_init (&ex);
+ nntp_store_connect (CAMEL_SERVICE (store), &ex);
+ if (camel_exception_get_id (&ex)) {
+ camel_exception_clear (&ex);
+ return NULL;
+ }
+ camel_exception_clear (&ex);
+ }
+
data = g_ptr_array_new ();
while (1) {
buf = camel_stream_buffer_read_line (stream);