sync with 0.9.6cvs2
authorPaul Mangan <paul@claws-mail.org>
Wed, 8 Oct 2003 11:34:09 +0000 (11:34 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 8 Oct 2003 11:34:09 +0000 (11:34 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/folder.c
src/folder.h
src/mh.c
src/mh.h
src/news.c
src/news.h
src/summaryview.c

index daf23bc..c6212cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2003-10-07
+
+       * src/send_message.c: fixed format string bug (exploitable by
+         malicious SMTP server) when calling alertpanel_error()
+         (thanks to Georgi Guninski).
+
+2003-10-03
+
+       * src/folder.[ch]
+         src/imap.[ch]
+         src/mh.[ch]
+         src/news.[ch]: refactoring of the folder system (based on the claws'
+         implementation).
+       * src/account.c
+         src/foldersel.c
+         src/folderview.c
+         src/mainwindow.c
+         src/messageview.c
+         src/procmsg.c
+         src/setup.c
+         src/summaryview.c: use FOLDER_TYPE() macro at every place.
+
 2003-09-17
 
        * version 0.9.6
index 9bedd54..cb721c3 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-08 [paul]      0.9.6claws8
+
+       * sync with 0.9.6cvs2
+               see ChangeLog 2003-10-03
+
 2003-10-05 [christoph] 0.9.6claws7
 
        * src/summaryview.c
index 99cdb64..2b00b35 100644 (file)
@@ -1,3 +1,25 @@
+2003-10-07
+
+       * src/send_message.c: alertpanel_error() ¤ò¸Æ¤Ö¤È¤­¤Î¥Õ¥©¡¼¥Þ¥Ã¥È
+         Ê¸»úÎó¤Î¥Ð¥°(°­°Õ¤Î¤¢¤ë SMTP ¥µ¡¼¥Ð¤Ë¤è¤Ã¤Æ¹¶·â²Äǽ)¤ò½¤Àµ
+         (Georgi Guninski ¤µ¤ó thanks)¡£
+
+2003-10-03
+
+       * src/folder.[ch]
+         src/imap.[ch
+         src/mh.[ch]
+         src/news.[ch]: ¥Õ¥©¥ë¥À¥·¥¹¥Æ¥à¤Î¥ê¥Õ¥¡¥¯¥¿¥ê¥ó¥°(claws ¤Î¼ÂÁõ¤Ë
+         ´ð¤Å¤¯)¡£
+       * src/account.c
+         src/foldersel.c
+         src/folderview.c
+         src/mainwindow.c
+         src/messageview.c
+         src/procmsg.c
+         src/setup.c
+         src/summaryview.c: Á´¤Æ¤Î¾ì½ê¤Ç FOLDER_TYPE() ¥Þ¥¯¥í¤ò»ÈÍÑ¡£
+
 2003-09-17
 
        * version 0.9.6
index cb46072..2347539 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=7
+EXTRA_VERSION=8
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 236dd35..0f1eef0 100644 (file)
@@ -700,7 +700,8 @@ Folder *folder_find_from_path(const gchar *path)
 
        for (list = folder_list; list != NULL; list = list->next) {
                folder = list->data;
-               if ((FOLDER_TYPE(folder) == F_MH || FOLDER_TYPE(folder) == F_MBOX) &&
+               if ((FOLDER_TYPE(folder) == F_MH || 
+                    FOLDER_TYPE(folder) == F_MBOX) &&
                    !path_cmp(LOCAL_FOLDER(folder)->rootpath, path))
                        return folder;
        }
@@ -715,7 +716,8 @@ Folder *folder_find_from_name(const gchar *name, FolderClass *klass)
 
        for (list = folder_list; list != NULL; list = list->next) {
                folder = list->data;
-               if (folder->klass == klass && strcmp2(name, folder->name) == 0)
+               if (folder->klass == klass && 
+                   strcmp2(name, folder->name) == 0)
                        return folder;
        }
 
@@ -2556,7 +2558,9 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
                fprintf(fp, "<folder type=\"%s\"", folder->klass->idstr);
                if (folder->name)
                        PUT_ESCAPE_STR(fp, "name", folder->name);
-               if (FOLDER_TYPE(folder) == F_MH || FOLDER_TYPE(folder) == F_MBOX || FOLDER_TYPE(folder) == F_MAILDIR)
+               if (FOLDER_TYPE(folder) == F_MH || 
+                   FOLDER_TYPE(folder) == F_MBOX || 
+                   FOLDER_TYPE(folder) == F_MAILDIR)
                        PUT_ESCAPE_STR(fp, "path",
                                       LOCAL_FOLDER(folder)->rootpath);
                if (item->collapsed && node->children)
index 357d499..b34a804 100644 (file)
 #include <glib.h>
 #include <time.h>
 
-typedef struct _Folder                 Folder;
-typedef struct _FolderClass            FolderClass;
-typedef struct _LocalFolder            LocalFolder;
-typedef struct _RemoteFolder           RemoteFolder;
+typedef struct _Folder         Folder;
+typedef struct _FolderClass    FolderClass;
+
+typedef struct _LocalFolder    LocalFolder;
+typedef struct _RemoteFolder   RemoteFolder;
 #if 0
-typedef struct _MaildirFolder          MaildirFolder;
+typedef struct _MaildirFolder  MaildirFolder;
 #endif
-typedef struct _FolderItem             FolderItem;
 
+typedef struct _FolderItem     FolderItem;
 typedef struct _FolderUpdateData       FolderUpdateData;
 typedef struct _FolderItemUpdateData   FolderItemUpdateData;
 
 #define FOLDER(obj)            ((Folder *)obj)
+#define FOLDER_CLASS(obj)      (FOLDER(obj)->klass)
 #define FOLDER_TYPE(obj)       (FOLDER(obj)->klass->type)
 
-#define FOLDER_CLASS(obj)      (FOLDER(obj)->klass)
 #define LOCAL_FOLDER(obj)      ((LocalFolder *)obj)
 #define REMOTE_FOLDER(obj)     ((RemoteFolder *)obj)
 
index 59500c4..7902f44 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
 #include "procheader.h"
 #include "utils.h"
 
-static void mh_folder_init(Folder * folder,
-                          const gchar * name, const gchar * path);
-
-static Folder *mh_folder_new(const gchar * name, const gchar * path);
-static void mh_folder_destroy(Folder * folder);
-static gchar *mh_fetch_msg(Folder * folder, FolderItem * item, gint num);
-static MsgInfo *mh_get_msginfo(Folder * folder,
-                              FolderItem * item, gint num);
-static gint mh_add_msg(Folder * folder,
-                      FolderItem * dest,
-                      const gchar * file,
-                      MsgFlags * flags);
-static gint mh_add_msgs(Folder * folder,
-                FolderItem * dest, GSList * file_list, GRelation *relation);
-static gint mh_copy_msg(Folder * folder,
-                       FolderItem * dest, MsgInfo * msginfo);
-static gint mh_remove_msg(Folder * folder, FolderItem * item, gint num);
-static gint mh_remove_all_msg(Folder * folder, FolderItem * item);
-static gboolean mh_is_msg_changed(Folder * folder,
-                                 FolderItem * item, MsgInfo * msginfo);
-
-static gint mh_get_num_list(Folder * folder,
-                           FolderItem * item, GSList ** list, gboolean *old_uids_valid);
-static gint mh_scan_tree(Folder * folder);
-
-static gint mh_create_tree(Folder * folder);
-static FolderItem *mh_create_folder(Folder * folder,
-                                   FolderItem * parent,
-                                   const gchar * name);
-static gint mh_rename_folder(Folder * folder,
-                            FolderItem * item, const gchar * name);
-static gint mh_remove_folder(Folder * folder, FolderItem * item);
-
-static gchar *mh_get_new_msg_filename(FolderItem * dest);
-
-static MsgInfo *mh_parse_msg(const gchar * file, FolderItem * item);
+static void    mh_folder_init          (Folder         *folder,
+                                        const gchar    *name,
+                                        const gchar    *path);
+
+static Folder  *mh_folder_new          (const gchar    *name,
+                                        const gchar    *path);
+static void     mh_folder_destroy      (Folder         *folder);
+static gchar   *mh_fetch_msg           (Folder         *folder,
+                                        FolderItem     *item,
+                                        gint            num);
+static MsgInfo *mh_get_msginfo         (Folder         *folder,
+                                        FolderItem     *item,
+                                        gint            num);
+static gint     mh_add_msg             (Folder         *folder,
+                                        FolderItem     *dest,
+                                        const gchar    *file,
+                                        MsgFlags       *flags);
+static gint     mh_add_msgs            (Folder         *folder,
+                                        FolderItem     *dest,
+                                        GSList         *file_list,
+                                        GRelation      *relation);
+static gint     mh_copy_msg            (Folder         *folder,
+                                        FolderItem     *dest,
+                                        MsgInfo        *msginfo);
+static gint     mh_remove_msg          (Folder         *folder,
+                                        FolderItem     *item,
+                                        gint            num);
+static gint     mh_remove_all_msg      (Folder         *folder,
+                                        FolderItem     *item);
+static gboolean mh_is_msg_changed      (Folder         *folder,
+                                        FolderItem     *item,
+                                        MsgInfo        *msginfo);
+
+static gint    mh_get_num_list         (Folder         *folder,
+                                        FolderItem     *item, 
+                                        GSList         **list, 
+                                        gboolean       *old_uids_valid);
+static gint    mh_scan_tree            (Folder         *folder);
+
+static gint    mh_create_tree          (Folder         *folder);
+static FolderItem *mh_create_folder    (Folder         *folder,
+                                        FolderItem     *parent,
+                                        const gchar    *name);
+static gint    mh_rename_folder                (Folder         *folder,
+                                        FolderItem     *item,
+                                        const gchar    *name);
+static gint    mh_remove_folder                (Folder         *folder,
+                                        FolderItem     *item);
+
+static gchar   *mh_get_new_msg_filename                (FolderItem     *dest);
+
+static MsgInfo *mh_parse_msg                   (const gchar    *file,
+                                                FolderItem     *item);
 static void    mh_remove_missing_folder_items  (Folder         *folder);
-static void mh_scan_tree_recursive(FolderItem * item);
+static void    mh_scan_tree_recursive          (FolderItem     *item);
 
-static gboolean mh_rename_folder_func(GNode * node, gpointer data);
-static gchar *mh_item_get_path(Folder *folder, FolderItem *item);
+static gboolean mh_rename_folder_func          (GNode          *node,
+                                                gpointer        data);
+static gchar   *mh_item_get_path               (Folder *folder, 
+                                                FolderItem *item);
 
-FolderClass mh_class =
+static FolderClass mh_class =
 {
        F_MH,
        "mh",
@@ -130,7 +149,7 @@ FolderClass *mh_get_class(void)
        return &mh_class;
 }
 
-Folder *mh_folder_new(const gchar *name, const gchar *path)
+static Folder *mh_folder_new(const gchar *name, const gchar *path)
 {
        Folder *folder;
 
@@ -233,7 +252,7 @@ gint mh_get_num_list(Folder *folder, FolderItem *item, GSList **list, gboolean *
        return nummsgs;
 }
 
-gchar *mh_fetch_msg(Folder *folder, FolderItem *item, gint num)
+static gchar *mh_fetch_msg(Folder *folder, FolderItem *item, gint num)
 {
        gchar *path;
        gchar *file;
@@ -252,7 +271,7 @@ gchar *mh_fetch_msg(Folder *folder, FolderItem *item, gint num)
        return file;
 }
 
-MsgInfo *mh_get_msginfo(Folder *folder, FolderItem *item, gint num)
+static MsgInfo *mh_get_msginfo(Folder *folder, FolderItem *item, gint num)
 {
        MsgInfo *msginfo;
        gchar *file;
@@ -272,7 +291,7 @@ MsgInfo *mh_get_msginfo(Folder *folder, FolderItem *item, gint num)
        return msginfo;
 }
 
-gchar *mh_get_new_msg_filename(FolderItem *dest)
+static gchar *mh_get_new_msg_filename(FolderItem *dest)
 {
        gchar *destfile;
        gchar *destpath;
@@ -298,7 +317,7 @@ gchar *mh_get_new_msg_filename(FolderItem *dest)
        return destfile;
 }
 
-gint mh_add_msg(Folder *folder, FolderItem *dest, const gchar *file, MsgFlags *flags)
+static gint mh_add_msg(Folder *folder, FolderItem *dest, const gchar *file, MsgFlags *flags)
 {
        gint ret;
        GSList file_list;
@@ -316,7 +335,7 @@ gint mh_add_msg(Folder *folder, FolderItem *dest, const gchar *file, MsgFlags *f
        return ret;
 } 
  
-gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list, 
+static gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list, 
                  GRelation *relation)
 { 
        gchar *destfile;
@@ -354,7 +373,7 @@ gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
        return dest->last_num;
 }
 
-gint mh_copy_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
+static gint mh_copy_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
 {
        gchar *srcfile;
        gchar *destfile;
@@ -420,7 +439,7 @@ gint mh_copy_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
        return dest->last_num;
 }
 
-gint mh_remove_msg(Folder *folder, FolderItem *item, gint num)
+static gint mh_remove_msg(Folder *folder, FolderItem *item, gint num)
 {
        gchar *file;
 
@@ -439,7 +458,7 @@ gint mh_remove_msg(Folder *folder, FolderItem *item, gint num)
        return 0;
 }
 
-gint mh_remove_all_msg(Folder *folder, FolderItem *item)
+static gint mh_remove_all_msg(Folder *folder, FolderItem *item)
 {
        gchar *path;
        gint val;
@@ -454,7 +473,8 @@ gint mh_remove_all_msg(Folder *folder, FolderItem *item)
        return val;
 }
 
-gboolean mh_is_msg_changed(Folder *folder, FolderItem *item, MsgInfo *msginfo)
+static gboolean mh_is_msg_changed(Folder *folder, FolderItem *item,
+                                 MsgInfo *msginfo)
 {
        struct stat s;
 
@@ -466,7 +486,7 @@ gboolean mh_is_msg_changed(Folder *folder, FolderItem *item, MsgInfo *msginfo)
        return FALSE;
 }
 
-gint mh_scan_tree(Folder *folder)
+static gint mh_scan_tree(Folder *folder)
 {
        FolderItem *item;
        gchar *rootpath;
@@ -507,7 +527,7 @@ gint mh_scan_tree(Folder *folder)
        } \
 }
 
-gint mh_create_tree(Folder *folder)
+static gint mh_create_tree(Folder *folder)
 {
        gchar *rootpath;
 
@@ -528,7 +548,7 @@ gint mh_create_tree(Folder *folder)
 
 #undef MAKE_DIR_IF_NOT_EXIST
 
-gchar *mh_item_get_path(Folder *folder, FolderItem *item)
+static gchar *mh_item_get_path(Folder *folder, FolderItem *item)
 {
        gchar *folder_path, *path;
 
@@ -558,8 +578,8 @@ gchar *mh_item_get_path(Folder *folder, FolderItem *item)
        return path;
 }
 
-FolderItem *mh_create_folder(Folder *folder, FolderItem *parent,
-                            const gchar *name)
+static FolderItem *mh_create_folder(Folder *folder, FolderItem *parent,
+                                   const gchar *name)
 {
        gchar *path;
        gchar *fullpath;
@@ -608,7 +628,8 @@ FolderItem *mh_create_folder(Folder *folder, FolderItem *parent,
        return new_item;
 }
 
-gint mh_rename_folder(Folder *folder, FolderItem *item, const gchar *name)
+static gint mh_rename_folder(Folder *folder, FolderItem *item,
+                            const gchar *name)
 {
        gchar *oldpath;
        gchar *dirname;
@@ -658,7 +679,7 @@ gint mh_rename_folder(Folder *folder, FolderItem *item, const gchar *name)
        return 0;
 }
 
-gint mh_remove_folder(Folder *folder, FolderItem *item)
+static gint mh_remove_folder(Folder *folder, FolderItem *item)
 {
        gchar *path;
 
index fd5ecfd..160259c 100644 (file)
--- a/src/mh.h
+++ b/src/mh.h
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
 #include <glib.h>
 
 #include "folder.h"
-#include "procmsg.h"
 
 typedef struct _MHFolder       MHFolder;
 
index 29df06e..3ea0cd5 100644 (file)
 #define NNTPS_PORT     563
 #endif
 
-static Folder *news_folder_new(const gchar * name, const gchar * folder);
-static void news_folder_destroy(Folder * folder);
-
-static gchar *news_fetch_msg(Folder * folder, FolderItem * item, gint num);
-
 static void news_folder_init            (Folder        *folder,
                                          const gchar   *name,
                                          const gchar   *path);
 
+static Folder  *news_folder_new        (const gchar    *name,
+                                        const gchar    *folder);
+static void     news_folder_destroy    (Folder         *folder);
+
+static gchar *news_fetch_msg           (Folder         *folder,
+                                        FolderItem     *item,
+                                        gint            num);
+
+
 #if USE_OPENSSL
 static Session *news_session_new        (const gchar   *server,
                                          gushort        port,
@@ -114,7 +118,7 @@ static gchar *news_folder_get_path   (Folder        *folder);
 gchar *news_item_get_path               (Folder        *folder,
                                          FolderItem    *item);
 
-FolderClass news_class =
+static FolderClass news_class =
 {
        F_NEWS,
        "news",
@@ -159,7 +163,7 @@ FolderClass *news_get_class(void)
        return &news_class;
 }
 
-Folder *news_folder_new(const gchar *name, const gchar *path)
+static Folder *news_folder_new(const gchar *name, const gchar *path)
 {
        Folder *folder;
 
@@ -170,7 +174,7 @@ Folder *news_folder_new(const gchar *name, const gchar *path)
        return folder;
 }
 
-void news_folder_destroy(Folder *folder)
+static void news_folder_destroy(Folder *folder)
 {
        gchar *dir;
 
@@ -252,7 +256,7 @@ static Session *news_session_new_for_folder(Folder *folder)
        return session;
 }
 
-NNTPSession *news_session_get(Folder *folder)
+static NNTPSession *news_session_get(Folder *folder)
 {
        RemoteFolder *rfolder = REMOTE_FOLDER(folder);
 
@@ -286,7 +290,7 @@ NNTPSession *news_session_get(Folder *folder)
        return NNTP_SESSION(rfolder->session);
 }
 
-gchar *news_fetch_msg(Folder *folder, FolderItem *item, gint num)
+static gchar *news_fetch_msg(Folder *folder, FolderItem *item, gint num)
 {
        gchar *path, *filename;
        NNTPSession *session;
index 302dedf..5230e6a 100644 (file)
@@ -46,14 +46,14 @@ struct _NewsGroupInfo
 };
 
 FolderClass *news_get_class            (void);
-gint news_post                         (Folder         * folder,
-                                        const gchar    * file);
 
-GSList *news_get_group_list            (Folder         * folder);
-void news_group_list_free              (GSList         * group_list);
-void news_remove_group_list_cache      (Folder         * folder);
+GSList *news_get_group_list            (Folder         *folder);
+void news_group_list_free              (GSList         *group_list);
+void news_remove_group_list_cache      (Folder         *folder);
 
-gint news_cancel_article               (Folder         * folder,
-                                        MsgInfo        * msginfo);
+gint news_post                         (Folder         *folder,
+                                        const gchar    *file);
+gint news_cancel_article               (Folder         *folder,
+                                        MsgInfo        *msginfo);
 
 #endif /* __NEWS_H__ */
index 11a8590..f21a3cd 100644 (file)
@@ -3075,9 +3075,6 @@ void summary_delete(SummaryView *summaryview)
        GtkCTreeNode *node;
 
        if (!item) return;
-#if 0
-       if (!item || item->folder->type == F_NEWS) return;
-#endif
 
        if (summary_is_locked(summaryview)) return;