sync with 0.7.4cvs16
authorPaul Mangan <paul@claws-mail.org>
Sat, 23 Mar 2002 09:35:55 +0000 (09:35 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 23 Mar 2002 09:35:55 +0000 (09:35 +0000)
14 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c
src/foldersel.c
src/folderview.c
src/imap.c
src/imap.h
src/mainwindow.c
src/procmsg.c
src/summaryview.c
src/utils.c
src/utils.h

index b9a4dc1..83387d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,56 @@
+2002-03-23
+
+       * src/compose.c
+         src/mainwindow.c
+         src/prefs_common.c: changed 'Tool' menu to 'Tools'.
+         Moved 'Delete duplicated messages' under 'Tools'.
+
+2002-03-23
+
+       * src/folderview.c: SET_SPECIAL_FOLDER(): keep the same parent
+         when moving.
+       * src/imap.c: imap_create_special_folder(): fixed a crash bug
+         when folder creation failed, and re-try to create folders under
+         INBOX.
+         imap_scan_tree_recursive(): don't automatically add namespace
+         prefix if it's INBOX. Search also under the INBOX for special
+         folders.
+       * src/foldersel.c: SET_SPECIAL_FOLDER(): keep the same parent
+         when moving.
+
+2002-03-23
+
+       * src/utils.[ch]: get_abbrev_newsgroup_name(): new. It returns the
+         abbreviated newsgroup name.
+       * src/folderview.c: folderview_update_node(): display newsgroups
+         with abbreviated name if name and path is the same.
+       * src/summaryview.c: summary_status_show(): show the newsgroup with
+         abbreviated name.
+
+2002-03-23
+
+       * src/foldersel.c
+         src/folderview.c: changed the label 'Draft' to 'Drafts'.
+       * src/imap.c: changed the directory name 'Draft' to 'Drafts'.
+         imap_create_missing_folders(): fixed the wrong assignment of
+         Queue folder to draft.
+
+2002-03-22
+
+       * enabled Sent / Draft / Queue folders on IMAP server.
+       * src/compose.c: compose_queue(), compose_draft_cb(): use account's
+         queue and draft folder if they exist.
+         src/imap.[ch]:
+         imap_create_trash(): removed.
+         imap_create_special_folder(): new. Generalized imap_create_trash().
+         imap_create_missing_folders(): automatically create missing folders.
+         imap_is_msg_changed(): added the dummy method.
+         imap_scan_tree_recursive(): search also Sent, Draft and Queue
+         folders. Minor code cleanups.
+         imap_parse_envelope(): check for null strings.
+         src/procmsg.c: procmsg_read_cache(): add F_QUEUE or F_DRAFT flag
+         for messages on IMAP folder.
+
 2002-03-20
 
        * src/compose.c: compose_send(): use account's outbox folder
index a55fee4..2664674 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-23 [paul]      0.7.4claws36
+
+       * sync with 0.7.4cvs16
+               see ChangeLog entries 2002-03-23
+
 2002-03-22 [christoph] 0.7.4claws35
 
        * src/quote_fmt_parse.y
index 16946ff..93ff500 100644 (file)
@@ -1,3 +1,56 @@
+2002-03-23
+
+       * src/compose.c
+         src/mainwindow.c
+         src/prefs_common.c: 'Tool' ¥á¥Ë¥å¡¼¤ò 'Tools' ¤ËÊѹ¹¡£
+         '½ÅÊ£¥á¥Ã¥»¡¼¥¸¤òºï½ü' ¤ò '¥Ä¡¼¥ë' ¤Î²¼¤Ë°ÜÆ°¡£
+
+2002-03-23
+
+       * src/folderview.c: SET_SPECIAL_FOLDER(): °ÜÆ°»þ¤ËƱ¤¸¿Æ¤òÊݤĤ褦¤Ë
+         ¤·¤¿¡£
+       * src/imap.c: imap_create_special_folder(): ¥Õ¥©¥ë¥À¤ÎºîÀ®¤Ë¼ºÇÔ¤·¤¿
+         ¤È¤­¤Ë¥¯¥é¥Ã¥·¥å¤¹¤ë¥Ð¥°¤ò½¤Àµ¤·¡¢ INBOX ¤Î²¼¤Ø¥Õ¥©¥ë¥À¤ÎºîÀ®¤ò
+         ºÆÅÙ»î¤ß¤ë¤è¤¦¤Ë¤·¤¿¡£
+         imap_scan_tree_recursive(): namespace ¥×¥ì¥Õ¥£¥¯¥¹¤¬ INBOX ¤Î¾ì¹ç
+         ¤Ï¤½¤ì¤ò¼«Æ°Åª¤ËÄɲ䷤ʤ¤¤è¤¦¤Ë¤·¤¿¡£ INBOX ¤Î²¼¤ÎÆÃÊÌ¥Õ¥©¥ë¥À¤â
+         Ãµ¤¹¤è¤¦¤Ë¤·¤¿¡£
+       * src/foldersel.c: SET_SPECIAL_FOLDER(): °ÜÆ°»þ¤ËƱ¤¸¿Æ¤òÊݤĤ褦¤Ë
+         ¤·¤¿¡£
+
+2002-03-23
+
+       * src/utils.[ch]: get_abbrev_newsgroup_name(): ¿·µ¬¡£¾Êά¤µ¤ì¤¿
+         ¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×̾¤òÊÖ¤¹¡£
+       * src/folderview.c: folderview_update_node(): name ¤È path ¤¬°ìÃ×
+         ¤¹¤ë¾ì¹ç¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤ò¾Êά̾¤Çɽ¼¨¡£
+       * src/summaryview.c: summary_status_show(): ¥Ë¥å¡¼¥¹¥°¥ë¡¼¥×¤ò¾Êά̾
+         ¤Çɽ¼¨¡£
+
+2002-03-23
+
+       * src/foldersel.c
+         src/folderview.c: ¥é¥Ù¥ë 'Draft' ¤ò 'Drafts' ¤ËÊѹ¹¡£
+       * src/imap.c: ¥Ç¥£¥ì¥¯¥È¥ê̾ 'Draft' ¤ò 'Drafts' ¤ËÊѹ¹¡£
+         imap_create_missing_folders(): Queue ¥Õ¥©¥ë¥À¤Î draft ¤Ø¤Î¸í¤Ã¤¿
+         ÂåÆþ¤ò½¤Àµ¡£
+
+2002-03-22
+
+       * IMAP ¥µ¡¼¥Ð¾å¤ÎÁ÷¿®¹µ / Áð¹Æ / Á÷¿®ÂÔ¤Á¥Õ¥©¥ë¥À¤òÍ­¸ú¤Ë¤·¤¿¡£
+       * src/compose.c: compose_queue(), compose_draft_cb(): Â¸ºß¤¹¤ì¤Ð
+         ¥¢¥«¥¦¥ó¥È¤ÎÁ÷¿®ÂÔ¤Á¡¢Áð¹Æ¥Õ¥©¥ë¥À¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         src/imap.[ch]:
+         imap_create_trash(): ºï½ü¡£
+         imap_create_special_folder(): ¿·µ¬¡£imap_create_trash() ¤ò°ìÈ̲½¡£
+         imap_create_missing_folders(): Â­¤ê¤Ê¤¤¥Õ¥©¥ë¥À¤ò¼«Æ°Åª¤ËºîÀ®¡£
+         imap_is_msg_changed(): ¥À¥ß¡¼¤Î¥á¥½¥Ã¥É¤òÄɲá£
+         imap_scan_tree_recursive(): Á÷¿®¹µ¡¢Áð¹Æ¡¢Á÷¿®ÂÔ¤Á¥Õ¥©¥ë¥À¤âõ¤¹
+         ¤è¤¦¤Ë¤·¤¿¡£¾¯¤·¥³¡¼¥É¤òÀ°Íý¡£
+         imap_parse_envelope(): ¥Ì¥ë¥¹¥È¥ê¥ó¥°¤ò¥Á¥§¥Ã¥¯¡£
+         src/procmsg.c: procmsg_read_cache(): IMAP ¥Õ¥©¥ë¥À¤Î¥á¥Ã¥»¡¼¥¸¤Ë
+         F_QUEUE ¤È F_DRAFT ¥Õ¥é¥°¤òÄɲá£
+
 2002-03-20
 
        * src/compose.c: compose_send(): ¥¢¥«¥¦¥ó¥È¤ÎÁ÷¿®¹µ¥Õ¥©¥ë¥À¤¬Â¸ºß
index f2f3e36..a046bbf 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws35
+EXTRA_VERSION=claws36
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 00c75d9..5717a4a 100644 (file)
@@ -3298,9 +3298,12 @@ static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item)
                g_free(tmp2);
                return -1;
        }
-                                               
-       /* queue message */
-       queue = folder_get_default_queue();
+
+       if (compose->account->folder &&
+           FOLDER(compose->account->folder)->queue)
+               queue = FOLDER(compose->account->folder)->queue;
+       else
+               queue = folder_get_default_queue();
 
        folder_item_scan(queue);
        queue_path = folder_item_get_path(queue);
@@ -5853,7 +5856,11 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
 
        if (lock) return;
 
-       draft = folder_get_default_draft();
+       if (compose->account && compose->account->folder &&
+           FOLDER(compose->account->folder)->draft)
+               draft = FOLDER(compose->account->folder)->draft;
+       else
+               draft = folder_get_default_draft();
        g_return_if_fail(draft != NULL);
 
        lock = TRUE;
@@ -5868,7 +5875,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
        }
 
        folder_item_scan(draft);
-       if ((msgnum = folder_item_add_msg(draft, tmp, TRUE)) <= 0) {
+       if ((msgnum = folder_item_add_msg(draft, tmp, TRUE)) < 0) {
                unlink(tmp);
                g_free(tmp);
                lock = FALSE;
index de7eedf..0af020f 100644 (file)
@@ -227,7 +227,7 @@ static gboolean foldersel_gnode_func(GtkCTree *ctree, guint depth,
                name = _("Trash");
                break;
        case F_DRAFT:
-               name = _("Draft");
+               name = _("Drafts");
                break;
        default:
                name = item->name;
@@ -268,20 +268,21 @@ static void foldersel_expand_func(GtkCTree *ctree, GtkCTreeNode *node,
 #define SET_SPECIAL_FOLDER(item) \
 { \
        if (item) { \
-               GtkCTreeNode *node_, *sibling; \
+               GtkCTreeNode *node_, *parent, *sibling; \
  \
                node_ = gtk_ctree_find_by_row_data \
                        (GTK_CTREE(ctree), node, item); \
                if (!node_) \
                        g_warning("%s not found.\n", item->path); \
                else { \
-                       if (!prev) \
-                               sibling = GTK_CTREE_ROW(node)->children; \
-                       else \
+                       parent = GTK_CTREE_ROW(node_)->parent; \
+                       if (prev && parent == GTK_CTREE_ROW(prev)->parent) \
                                sibling = GTK_CTREE_ROW(prev)->sibling; \
+                       else \
+                               sibling = GTK_CTREE_ROW(parent)->children; \
                        if (node_ != sibling) \
                                gtk_ctree_move(GTK_CTREE(ctree), \
-                                              node_, node, sibling); \
+                                              node_, parent, sibling); \
                } \
  \
                prev = node_; \
index 754e923..d04a4be 100644 (file)
@@ -1042,7 +1042,7 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                        openxpm = folderopenxpm;
                        openmask = folderopenxpmmask;
                }
-               name = g_strdup(_("Draft"));
+               name = g_strdup(_("Drafts"));
                break;
        default:
                if (item->hide_read_msgs) {
@@ -1070,8 +1070,13 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                                name = "";
                        }
                        name = g_strconcat(item->name, name, NULL);
-               } else
-                       name = g_strdup(item->name);
+               } else {
+                       if (item->folder->type == F_NEWS &&
+                           !strcmp2(item->name, item->path))
+                               name = get_abbrev_newsgroup_name(item->path);
+                       else
+                               name = g_strdup(item->name);
+               }
        }
 
        if (!GTK_CTREE_ROW(node)->expanded &&
@@ -1227,18 +1232,19 @@ static void folderview_expand_func(GtkCTree *ctree, GtkCTreeNode *node,
 #define SET_SPECIAL_FOLDER(ctree, item) \
 { \
        if (item) { \
-               GtkCTreeNode *node, *sibling; \
+               GtkCTreeNode *node, *parent, *sibling; \
  \
                node = gtk_ctree_find_by_row_data(ctree, root, item); \
                if (!node) \
                        g_warning("%s not found.\n", item->path); \
                else { \
-                       if (!prev) \
-                               sibling = GTK_CTREE_ROW(root)->children; \
-                       else \
+                       parent = GTK_CTREE_ROW(node)->parent; \
+                       if (prev && parent == GTK_CTREE_ROW(prev)->parent) \
                                sibling = GTK_CTREE_ROW(prev)->sibling; \
+                       else \
+                               sibling = GTK_CTREE_ROW(parent)->children; \
                        if (node != sibling) \
-                               gtk_ctree_move(ctree, node, root, sibling); \
+                               gtk_ctree_move(ctree, node, parent, sibling); \
                } \
  \
                prev = node; \
index 60d136c..a684338 100644 (file)
@@ -84,7 +84,12 @@ static gint imap_scan_tree_recursive (IMAPSession    *session,
                                         IMAPNameSpace  *namespace);
 static GSList *imap_parse_list         (IMAPSession    *session,
                                         const gchar    *real_path);
-static gint imap_create_trash          (Folder         *folder);
+
+static void imap_create_missing_folders        (Folder                 *folder);
+static FolderItem *imap_create_special_folder
+                                       (Folder                 *folder,
+                                        SpecialFolderItemType   stype,
+                                        const gchar            *name);
 
 static gint imap_do_copy               (Folder         *folder,
                                         FolderItem     *dest,
@@ -293,6 +298,7 @@ static void imap_folder_init(Folder *folder, const gchar *name,
        folder->copy_msgs_with_dest = imap_copy_msgs_with_dest;
        folder->remove_msg          = imap_remove_msg;
        folder->remove_all_msg      = imap_remove_all_msg;
+       folder->is_msg_changed      = imap_is_msg_changed;
        folder->scan                = imap_scan_folder;
        folder->scan_tree           = imap_scan_tree;
        folder->create_tree         = imap_create_tree;
@@ -910,6 +916,12 @@ gint imap_remove_all_msg(Folder *folder, FolderItem *item)
        return IMAP_SUCCESS;
 }
 
+gboolean imap_is_msg_changed(Folder *folder, FolderItem *item, MsgInfo *msginfo)
+{
+       /* TODO: properly implement this method */
+       return FALSE;
+}
+
 void imap_scan_folder(Folder *folder, FolderItem *item)
 {
        IMAPSession *session;
@@ -937,7 +949,7 @@ void imap_scan_folder(Folder *folder, FolderItem *item)
 void imap_scan_tree(Folder *folder)
 {
        IMAPFolder *imapfolder = IMAP_FOLDER(folder);
-       FolderItem *item, *inbox;
+       FolderItem *item;
        IMAPSession *session;
        IMAPNameSpace *namespace = NULL;
        gchar *root_folder = NULL;
@@ -973,19 +985,13 @@ void imap_scan_tree(Folder *folder)
 
        imap_scan_tree_recursive(session, item, namespace);
 
-       if (!folder->inbox) {
-               inbox = folder_item_new("INBOX", "INBOX");
-               inbox->stype = F_INBOX;
-               folder_item_append(item, inbox);
-               folder->inbox = inbox;
-       }
-       if (!folder->trash)
-               imap_create_trash(folder);
+       imap_create_missing_folders(folder);
 }
 
 static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item,
                                     IMAPNameSpace *namespace)
 {
+       Folder *folder;
        IMAPFolder *imapfolder;
        FolderItem *new_item;
        GSList *item_list, *cur;
@@ -998,14 +1004,14 @@ static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item,
        g_return_val_if_fail(item->folder != NULL, -1);
        g_return_val_if_fail(item->no_sub == FALSE, -1);
 
-       imapfolder = IMAP_FOLDER(item->folder);
+       folder = FOLDER(item->folder);
+       imapfolder = IMAP_FOLDER(folder);
 
        if (namespace && namespace->separator)
                separator = namespace->separator;
 
        if (item->folder->ui_func)
-               item->folder->ui_func(item->folder, item,
-                                     item->folder->ui_func_data);
+               item->folder->ui_func(folder, item, folder->ui_func_data);
 
        if (item->path) {
                wildcard[0] = separator;
@@ -1015,7 +1021,8 @@ static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item,
        } else {
                wildcard[0] = '%';
                wildcard[1] = '\0';
-               real_path = g_strdup(namespace && namespace->name
+               real_path = g_strdup(namespace && namespace->name &&
+                                    strncmp(namespace->name, "INBOX", 5) != 0
                                     ? namespace->name : "");
        }
 
@@ -1033,22 +1040,35 @@ static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item,
        for (cur = item_list; cur != NULL; cur = cur->next) {
                new_item = cur->data;
                if (!strcmp(new_item->path, "INBOX")) {
-                       if (!item->folder->inbox) {
+                       if (!folder->inbox) {
                                new_item->stype = F_INBOX;
                                item->folder->inbox = new_item;
                        } else {
                                folder_item_destroy(new_item);
                                continue;
                        }
-               } else if (!item->parent && !item->folder->trash) {
-                       if (!strcasecmp(g_basename(new_item->path), "Trash")) {
+               } else if (!item->parent || item->stype == F_INBOX) {
+                       gchar *base;
+
+                       base = g_basename(new_item->path);
+
+                       if (!folder->outbox && !strcasecmp(base, "Sent")) {
+                               new_item->stype = F_OUTBOX;
+                               folder->outbox = new_item;
+                       } else if (!folder->draft && !strcasecmp(base, "Drafts")) {
+                               new_item->stype = F_DRAFT;
+                               folder->draft = new_item;
+                       } else if (!folder->queue && !strcasecmp(base, "Queue")) {
+                               new_item->stype = F_QUEUE;
+                               folder->queue = new_item;
+                       } else if (!folder->trash && !strcasecmp(base, "Trash")) {
                                new_item->stype = F_TRASH;
-                               item->folder->trash = new_item;
+                               folder->trash = new_item;
                        }
                }
                folder_item_append(item, new_item);
                if (new_item->no_select == FALSE)
-                       imap_scan_folder(new_item->folder, new_item);
+                       imap_scan_folder(folder, new_item);
                if (new_item->no_sub == FALSE)
                        imap_scan_tree_recursive(session, new_item, namespace);
        }
@@ -1141,62 +1161,65 @@ static GSList *imap_parse_list(IMAPSession *session, const gchar *real_path)
 
 gint imap_create_tree(Folder *folder)
 {
-       FolderItem *item;
-
        g_return_val_if_fail(folder != NULL, -1);
        g_return_val_if_fail(folder->node != NULL, -1);
        g_return_val_if_fail(folder->node->data != NULL, -1);
        g_return_val_if_fail(folder->account != NULL, -1);
 
        imap_scan_tree(folder);
+       imap_create_missing_folders(folder);
 
-       item = FOLDER_ITEM(folder->node->data);
+       return 0;
+}
 
-       if (!folder->inbox) {
-               FolderItem *inbox;
+static void imap_create_missing_folders(Folder *folder)
+{
+       g_return_if_fail(folder != NULL);
 
-               inbox = folder_item_new("INBOX", "INBOX");
-               inbox->stype = F_INBOX;
-               folder_item_append(item, inbox);
-               folder->inbox = inbox;
-       }
+       if (!folder->inbox)
+               folder->inbox = imap_create_special_folder
+                       (folder, F_INBOX, "INBOX");
+       if (!folder->outbox)
+               folder->outbox = imap_create_special_folder
+                       (folder, F_OUTBOX, "Sent");
+       if (!folder->draft)
+               folder->draft = imap_create_special_folder
+                       (folder, F_DRAFT, "Drafts");
+       if (!folder->queue)
+               folder->queue = imap_create_special_folder
+                       (folder, F_QUEUE, "Queue");
        if (!folder->trash)
-               imap_create_trash(folder);
-
-       return 0;
+               folder->trash = imap_create_special_folder
+                       (folder, F_TRASH, "Trash");
 }
 
-static gint imap_create_trash(Folder *folder)
+static FolderItem *imap_create_special_folder(Folder *folder,
+                                             SpecialFolderItemType stype,
+                                             const gchar *name)
 {
        FolderItem *item;
        FolderItem *new_item;
 
-       g_return_val_if_fail(folder != NULL, -1);
-       g_return_val_if_fail(folder->node != NULL, -1);
-       g_return_val_if_fail(folder->node->data != NULL, -1);
-       g_return_val_if_fail(folder->account != NULL, -1);
+       g_return_val_if_fail(folder != NULL, NULL);
+       g_return_val_if_fail(folder->node != NULL, NULL);
+       g_return_val_if_fail(folder->node->data != NULL, NULL);
+       g_return_val_if_fail(folder->account != NULL, NULL);
+       g_return_val_if_fail(name != NULL, NULL);
 
        item = FOLDER_ITEM(folder->node->data);
-       new_item = imap_create_folder(folder, item, "Trash");
+       new_item = imap_create_folder(folder, item, name);
 
        if (!new_item) {
-               gchar *path;
-
-               new_item = folder_item_new("Trash", "Trash");
-               folder_item_append(item, new_item);
+               g_warning(_("Can't create '%s'\n"), name);
+               if (!folder->inbox) return NULL;
 
-               path = folder_item_get_path(new_item);
-               if (!is_dir_exist(path))
-                       make_dir_hier(path);
-               g_free(path);
-       } else {
-               g_free(new_item->name);
-               new_item->name = g_strdup("Trash");
-       }
-       new_item->stype = F_TRASH;
-       folder->trash = new_item;
+               new_item = imap_create_folder(folder, folder->inbox, name);
+               if (!new_item)
+                       g_warning(_("Can't create '%s' under INBOX\n"), name);
+       } else
+               new_item->stype = stype;
 
-       return 0;
+       return new_item;
 }
 
 FolderItem *imap_create_folder(Folder *folder, FolderItem *parent,
@@ -1467,6 +1490,11 @@ static GSList *imap_get_uncached_messages(IMAPSession *session,
                        log_warning(_("can't parse envelope: %s\n"), str->str);
                        continue;
                }
+               if (item->stype == F_QUEUE) {
+                       MSG_SET_TMP_FLAGS(msginfo->flags, MSG_QUEUED);
+               } else if (item->stype == F_DRAFT) {
+                       MSG_SET_TMP_FLAGS(msginfo->flags, MSG_DRAFT);
+               }
 
                msginfo->folder = item;
 
@@ -1920,8 +1948,10 @@ static MsgInfo *imap_parse_envelope(SockInfo *sock, GString *line_str)
                        g_return_val_if_fail(*cur_pos == '(', NULL);
                        cur_pos = imap_parse_atom
                                (sock, cur_pos + 1, buf, sizeof(buf), line_str);
-                       Xstrdup_a(date, buf, return NULL);
-                       date_t = procheader_date_parse(NULL, date, 0);
+                       if (buf[0] != '\0') {
+                               Xstrdup_a(date, buf, return NULL);
+                               date_t = procheader_date_parse(NULL, date, 0);
+                       }
 
                        cur_pos = imap_parse_atom
                                (sock, cur_pos, buf, sizeof(buf), line_str);
@@ -1935,12 +1965,16 @@ static MsgInfo *imap_parse_envelope(SockInfo *sock, GString *line_str)
                                                     &tmp_from, &tmp_fromname,
                                                     line_str);
                        g_return_val_if_fail(cur_pos != NULL, NULL);
-                       Xstrdup_a(from, tmp_from,
-                                 {g_free(tmp_from); g_free(tmp_fromname);
-                                  return NULL;});
-                       Xstrdup_a(fromname, tmp_fromname,
-                                 {g_free(tmp_from); g_free(tmp_fromname);
-                                  return NULL;});
+                       if (tmp_from && *tmp_from != '\0')
+                               Xstrdup_a(from, tmp_from,
+                                         {g_free(tmp_from);
+                                          g_free(tmp_fromname);
+                                          return NULL;});
+                       if (tmp_fromname && *tmp_fromname != '\0')
+                               Xstrdup_a(fromname, tmp_fromname,
+                                         {g_free(tmp_from);
+                                          g_free(tmp_fromname);
+                                          return NULL;});
                        g_free(tmp_from);
                        g_free(tmp_fromname);
 
index 59388c4..c323ed2 100644 (file)
@@ -123,6 +123,9 @@ gint imap_remove_msg                        (Folder         *folder,
                                         gint            uid);
 gint imap_remove_all_msg               (Folder         *folder,
                                         FolderItem     *item);
+gboolean imap_is_msg_changed           (Folder         *folder,
+                                        FolderItem     *item,
+                                        MsgInfo        *msginfo);
 
 void imap_scan_folder                  (Folder         *folder,
                                         FolderItem     *item);
index 4ac9e18..d0845ac 100644 (file)
@@ -656,10 +656,10 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Message/_Delete"),               "<control>D", delete_cb,  0, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/_Mark"),                 NULL, NULL, 0, "<Branch>"},
-       {N_("/_Message/_Mark/_Mark"),           NULL, mark_cb,   0, NULL},
+       {N_("/_Message/_Mark/_Mark"),           "<shift>asterisk", mark_cb, 0, NULL},
        {N_("/_Message/_Mark/_Unmark"),         "U", unmark_cb, 0, NULL},
        {N_("/_Message/_Mark/---"),             NULL, NULL, 0, "<Separator>"},
-       {N_("/_Message/_Mark/Mark as unr_ead"), NULL, mark_as_unread_cb, 0, NULL},
+       {N_("/_Message/_Mark/Mark as unr_ead"), "<shift>exclam", mark_as_unread_cb, 0, NULL},
        {N_("/_Message/_Mark/Mark as rea_d"),
                                                NULL, mark_as_read_cb, 0, NULL},
        {N_("/_Message/_Mark/Mark all _read"),  NULL, mark_all_read_cb, 0, NULL},
@@ -1591,12 +1591,13 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/Message/Delete"                , M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
                {"/Message/Mark"                  , M_TARGET_EXIST},
 
-               {"/Tools/Delete duplicated messages", M_MSG_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
                {"/Tools/Add sender to address book", M_SINGLE_TARGET_EXIST},
                {"/Tools/Filter messages"           , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
                {"/Tools/Create filter rule"        , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
                {"/Tools/Execute"                   , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
                {"/Tools/Actions"                   , M_MSG_EXIST},
+               {"/Tools/Delete duplicated messages", M_MSG_EXIST|M_ALLOW_DELETE|M_UNLOCKED},
+
                {"/Configuration", M_UNLOCKED},
 
                {NULL, 0}
index 8d3ef59..8ca0074 100644 (file)
@@ -181,13 +181,14 @@ GSList *procmsg_read_cache(FolderItem *item, gboolean scan_file)
 
        default_flags.perm_flags = MSG_NEW|MSG_UNREAD;
        default_flags.tmp_flags = MSG_CACHED;
-       if (type == F_MH) {
+       if (type == F_MH || type == F_IMAP) {
                if (item->stype == F_QUEUE) {
                        MSG_SET_TMP_FLAGS(default_flags, MSG_QUEUED);
                } else if (item->stype == F_DRAFT) {
                        MSG_SET_TMP_FLAGS(default_flags, MSG_DRAFT);
                }
-       } else if (type == F_IMAP) {
+       }
+       if (type == F_IMAP) {
                MSG_SET_TMP_FLAGS(default_flags, MSG_IMAP);
        } else if (type == F_NEWS) {
                MSG_SET_TMP_FLAGS(default_flags, MSG_NEWS);
index 88b1bb4..e1a614d 100644 (file)
@@ -1681,11 +1681,16 @@ static void summary_status_show(SummaryView *summaryview)
                n_selected++;
        }
 
-       gtk_label_set(GTK_LABEL(summaryview->statlabel_folder),
-                     summaryview->folder_item &&
-                     summaryview->folder_item->folder->type == F_NEWS
-                     ? g_basename(summaryview->folder_item->path)
-                     : summaryview->folder_item->path);
+       if (summaryview->folder_item->folder->type == F_NEWS) {
+               gchar *group;
+               group = get_abbrev_newsgroup_name
+                       (g_basename(summaryview->folder_item->path));
+               gtk_label_set(GTK_LABEL(summaryview->statlabel_folder), group);
+               g_free(group);
+       } else {
+               gtk_label_set(GTK_LABEL(summaryview->statlabel_folder),
+                             summaryview->folder_item->path);
+       }
 
        if (summaryview->deleted)
                del = g_strdup_printf(_("%d deleted"), summaryview->deleted);
index 818c6b6..9cf6925 100644 (file)
@@ -1123,6 +1123,31 @@ gchar **strsplit_with_quote(const gchar *str, const gchar *delim,
        return str_array;
 }
 
+gchar *get_abbrev_newsgroup_name(const gchar *group)
+{
+       gchar *abbrev_group;
+       gchar *ap;
+       const gchar *p = group;
+
+       abbrev_group = ap = g_malloc(strlen(group) + 1);
+
+       while (*p) {
+               while (*p == '.')
+                       *ap++ = *p++;
+               if (strchr(p, '.')) {
+                       *ap++ = *p++;
+                       while (*p != '.') p++;
+                       *ap++ = *p++;
+               } else {
+                       strcpy(ap, p);
+                       return abbrev_group;
+               }
+       }
+
+       *ap = '\0';
+       return abbrev_group;
+}
+
 GList *uri_list_extract_filenames(const gchar *uri_list)
 {
        GList *result = NULL;
index bc108a3..e69dd26 100644 (file)
@@ -276,6 +276,8 @@ gchar **strsplit_with_quote         (const gchar    *str,
                                         const gchar    *delim,
                                         gint            max_tokens);
 
+gchar *get_abbrev_newsgroup_name       (const gchar    *group);
+
 GList *uri_list_extract_filenames      (const gchar    *uri_list);
 void decode_uri                                (gchar          *decoded_uri,
                                         const gchar    *encoded_uri);