0.8.8claws78
authorChristoph Hohmann <reboot@gmx.ch>
Fri, 10 Jan 2003 21:56:39 +0000 (21:56 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Fri, 10 Jan 2003 21:56:39 +0000 (21:56 +0000)
* src/imap.c
        o fix warnings
        o use CAPABILITY to check if NAMESPACE is available

ChangeLog.claws
configure.in
src/imap.c

index 7cf4d95..9ad3279 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-10 [christoph] 0.8.8claws78
+
+       * src/imap.c
+               o fix warnings
+               o use CAPABILITY to check if NAMESPACE is available
+
 2003-01-10 [christoph] 0.8.8claws77
 
        * src/imap.[ch]
index 89f69b6..1f5c1c8 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws77
+EXTRA_VERSION=claws78
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index b797dcd..7ec4baa 100644 (file)
@@ -108,10 +108,12 @@ static gint imap_do_copy          (Folder         *folder,
                                         FolderItem     *dest,
                                         MsgInfo        *msginfo,
                                         gboolean        remove_source);
+#if 0
 static gint imap_do_copy_msgs_with_dest        (Folder         *folder,
                                         FolderItem     *dest, 
                                         GSList         *msglist,
                                         gboolean        remove_source);
+#endif
 
 static GSList *imap_get_uncached_messages      (IMAPSession    *session,
                                                 FolderItem     *item,
@@ -280,8 +282,6 @@ static gchar *search_array_contain_str              (GPtrArray      *array,
                                                 const gchar    *str);
 static gchar *search_array_str                 (GPtrArray      *array,
                                                 const gchar    *str);
-static gchar *search_array_exact_str           (GPtrArray *array,
-                                                const gchar *str);
 static void imap_path_separator_subst          (gchar          *str,
                                                 gchar           separator);
 
@@ -794,7 +794,7 @@ static gint imap_do_copy(Folder *folder, FolderItem *dest, MsgInfo *msginfo,
        IMAPSession *session;
        IMAPFlags iflags = 0;
        gint messages, recent, unseen;
-       guint32 newuid = 0, uid_validity, tmp;
+       guint32 newuid = 0, uid_validity;
        gint ok;
     
        g_return_val_if_fail(folder != NULL, -1);
@@ -1974,14 +1974,23 @@ static void imap_parse_namespace(IMAPSession *session, IMAPFolder *folder)
            folder->ns_shared   != NULL)
                return;
 
+       if (!imap_has_capability(session, "NAMESPACE")) {
+               imap_get_namespace_by_list(session, folder);
+               return;
+       }
+       
        if (imap_cmd_namespace(SESSION(session)->sock, &ns_str)
            != IMAP_SUCCESS) {
                log_warning(_("can't get namespace\n"));
-               imap_get_namespace_by_list(session, folder);
                return;
        }
 
        str_array = strsplit_parenthesis(ns_str, '(', ')', 3);
+       if (str_array == NULL) {
+               g_free(ns_str);
+               imap_get_namespace_by_list(session, folder);
+               return;
+       }
        if (str_array[0])
                folder->ns_personal = imap_parse_namespace_str(str_array[0]);
        if (str_array[0] && str_array[1])
@@ -3096,19 +3105,6 @@ static gchar *get_quoted(const gchar *src, gchar ch, gchar *dest, gint len)
        return (gchar *)(*p == ch ? p + 1 : p);
 }
 
-static gchar *search_array_exact_str(GPtrArray *array, const gchar *str)
-{
-       gint i;
-
-       for (i = 0; i < array->len; i++) {
-               gchar *tmp;
-               tmp = g_ptr_array_index(array, i);
-               if (strcmp(tmp, str) == 0)
-                       return tmp;
-       }
-       return NULL;
-}
-
 static gchar *search_array_contain_str(GPtrArray *array, const gchar *str)
 {
        gint i;
@@ -3465,7 +3461,7 @@ MsgInfo *imap_get_msginfo(Folder *folder, FolderItem *item, gint uid)
        ok = imap_select(session, IMAP_FOLDER(folder), item->path,
                         NULL, NULL, NULL, NULL);
        if (ok != IMAP_SUCCESS)
-               return -1;
+               return NULL;
 
        if (!(item->stype == F_QUEUE || item->stype == F_DRAFT)) {
                GSList *list;