From 4b89a1c6b25b16241b216531a1c70ccb95e55d6d Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 27 Nov 2001 23:05:30 +0000 Subject: If the uid doesn't have a ',' in it, fail to crash. 2001-11-25 Not Zed * providers/nntp/camel-nntp-folder.c (nntp_folder_get_message): If the uid doesn't have a ',' in it, fail to crash. * providers/nntp/camel-nntp-newsrc.c (camel_nntp_newsrc_article_is_read): check group != NULL before scanning. (camel_nntp_newsrc_get_highest_article_read): " (camel_nntp_newsrc_get_num_articles_read): " (camel_nntp_newsrc_mark_range_read): " * providers/nntp/camel-nntp-store.c (camel_nntp_store_get_overview_fmt): IF we dont have nntp_list_follows, dont try and get a list response. (nntp_store_get_folder_info): Set path part of folderinfo. svn path=/trunk/; revision=14799 --- camel/providers/nntp/camel-nntp-store.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'camel/providers/nntp/camel-nntp-store.c') diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index 9ff097f7f5..7ac3fcdc82 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -59,6 +59,18 @@ static CamelServiceClass *service_class = NULL; static gboolean ensure_news_dir_exists (CamelNNTPStore *store); +static int +camel_nntp_store_set_mode (CamelNNTPStore *store, CamelException *ex) +{ + int rc; + + CAMEL_NNTP_STORE_LOCK(store); + rc = camel_nntp_command(store, ex, NULL, "MODE READER"); + CAMEL_NNTP_STORE_UNLOCK(store); + + return rc; +} + static void camel_nntp_store_get_extensions (CamelNNTPStore *store, CamelException *ex) { @@ -137,8 +149,9 @@ camel_nntp_store_get_overview_fmt (CamelNNTPStore *store, CamelException *ex) g_warning ("server reported support of OVER but LIST OVERVIEW.FMT failed." " disabling OVER.\n"); store->extensions &= ~CAMEL_NNTP_EXT_OVER; - return; } + CAMEL_NNTP_STORE_UNLOCK(store); + return; } else { if (!(store->extensions & CAMEL_NNTP_EXT_OVER)) { @@ -261,6 +274,9 @@ nntp_store_connect (CamelService *service, CamelException *ex) g_free (buf); + /* set 'reader' mode */ + camel_nntp_store_set_mode(store, ex); + /* get a list of extensions that the server supports */ camel_nntp_store_get_extensions (store, ex); @@ -461,6 +477,7 @@ build_folder_info_from_grouplist (CamelNNTPStore *nntp_store, const char *top) fi->unread_message_count = (entry->high - entry->low - camel_nntp_newsrc_get_num_articles_read ( nntp_store->newsrc, entry->group_name)); + camel_folder_info_build_path(fi, '/'); if (last) last->sibling = fi; @@ -523,6 +540,7 @@ nntp_store_get_folder_info (CamelStore *store, const char *top, url->host, (char *)names->pdata[i]); /* FIXME */ fi->unread_message_count = -1; + camel_folder_info_build_path(fi, '/'); if (last) last->sibling = fi; @@ -543,6 +561,7 @@ nntp_store_get_folder_info (CamelStore *store, const char *top, fi->url = g_strdup_printf ("nntp://%s/%s", url->host, top); /* FIXME */ fi->unread_message_count = -1; + camel_folder_info_build_path(fi, '/'); return fi; } -- cgit v1.2.3