aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/subscribe-dialog.c28
2 files changed, 31 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 0c2b5591d1..4803929966 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2000-10-11 Chris Toshok <toshok@helixcode.com>
+
+ * subscribe-dialog.c (folder_etree_value_at): special case for
+ folders with NULL urls (which aren't selected/subscribeable).
+ (unsubscribe_folder_info): can't (un)subscribe from folders with
+ non-NULL urls.
+ (subscribe_folder_info): same.
+
2000-10-12 Christopher James Lahey <clahey@helixcode.com>
* message-list.c: Replace To with From except in Drafts, Outbox,
diff --git a/mail/subscribe-dialog.c b/mail/subscribe-dialog.c
index fc8b6b7282..d486df97df 100644
--- a/mail/subscribe-dialog.c
+++ b/mail/subscribe-dialog.c
@@ -144,8 +144,13 @@ static void
subscribe_folder_info (SubscribeDialog *sc, CamelFolderInfo *info)
{
char *path;
- CamelException *ex = camel_exception_new ();
+ CamelException *ex;
+ /* folders without urls cannot be subscribed to */
+ if (info->url == NULL)
+ return;
+
+ ex = camel_exception_new ();
path = g_strdup_printf ("/%s", info->full_name);
camel_store_subscribe_folder (sc->store, path, ex);
@@ -166,8 +171,13 @@ static void
unsubscribe_folder_info (SubscribeDialog *sc, CamelFolderInfo *info)
{
char *path;
- CamelException *ex = camel_exception_new ();
+ CamelException *ex;
+
+ /* folders without urls cannot be subscribed to */
+ if (info->url == NULL)
+ return;
+ ex = camel_exception_new ();
path = g_strdup_printf ("/%s", info->full_name);
camel_store_unsubscribe_folder (sc->store, path, ex);
@@ -381,10 +391,18 @@ folder_etree_value_at (ETreeModel *etree, ETreePath *path, int col, void *model_
SubscribeDialog *dialog = SUBSCRIBE_DIALOG (model_data);
CamelFolderInfo *info = e_tree_model_node_get_data (etree, path);
- if (col == FOLDER_COL_NAME)
+ if (col == FOLDER_COL_NAME) {
return info->name;
- else /* FOLDER_COL_SUBSCRIBED */
- return GINT_TO_POINTER(folder_info_subscribed(dialog, info));
+ }
+ else /* FOLDER_COL_SUBSCRIBED */ {
+ /* folders without urls cannot be subscribed to */
+ if (info->url == NULL)
+ return 0; /* empty */
+ else if (!folder_info_subscribed(dialog, info))
+ return 0; /* XXX unchecked */
+ else
+ return 1; /* checked */
+ }
}
static void