imap server gets informed of MARKED, UNMARKED and REPLY events
authorPaul Mangan <paul@claws-mail.org>
Mon, 10 Dec 2001 09:12:24 +0000 (09:12 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 10 Dec 2001 09:12:24 +0000 (09:12 +0000)
AUTHORS
ChangeLog.claws
configure.in
src/compose.c
src/imap.c
src/imap.h
src/summaryview.c

diff --git a/AUTHORS b/AUTHORS
index d7e2c37..7e734a6 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -98,3 +98,4 @@ contributors (beside the above; based on Changelog)
        Shimamoto "Neko" Tatsuya
         Jesse Skinner
         Willem van Engen
+       Tobias Sandhaas
index bbb4aaa..922774f 100644 (file)
@@ -1,3 +1,15 @@
+2001-12-10 [paul]      0.6.5claws71
+
+       * src/compose.c
+       * src/imap.[ch]
+       * src/summaryview.c
+               fix: imap server now gets informed of MARKED, UNMARKED
+               and REPLY events. Now people can use different IMAP-Mail
+               clients and have the exact same information about MARKED,
+               UNMARKED and REPLY status with all of them. Especially
+               useful for imap servers with a web-frontend.
+               submitted by Tobias Sandhaas <medlor@web.de>
+
 2001-12-09 [melvin]    0.6.5claws70
        
        * src/textview.[ch]
index ccc76c3..ff4ff3a 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws70
+EXTRA_VERSION=claws71
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index f8a7d4b..009061b 100644 (file)
@@ -706,6 +706,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
 
        MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
        MSG_SET_PERM_FLAGS(msginfo->flags, MSG_REPLIED);
+       imap_do_reply(msginfo);
 
        CHANGE_FLAGS(msginfo);
 
index 43e4b94..60ba2dd 100644 (file)
@@ -592,6 +592,51 @@ static gint imap_do_copy(Folder *folder, FolderItem *dest, MsgInfo *msginfo,
        return ok;
 }
 
+gint imap_do_mark        (MsgInfo    *msginfo)
+{
+    Folder     *folder = msginfo->folder->folder;
+    IMAPSession *session;
+
+    g_return_val_if_fail(folder != NULL, -1);
+    g_return_val_if_fail(folder->type == F_IMAP, -1);
+    g_return_val_if_fail(msginfo != NULL, -1);
+
+    session = imap_session_get(folder);
+    if (!session) return -1;
+    debug_print(_("imap_do_mark(): Message %s/%d is marked . %d\n"), msginfo->folder->path, msginfo->msgnum, folder->type);
+    imap_set_message_flags(session, msginfo->msgnum, msginfo->msgnum, IMAP_FLAG_FLAGGED, TRUE);
+}
+
+gint imap_do_unmark        (MsgInfo    *msginfo)
+{
+    Folder     *folder = msginfo->folder->folder;
+    IMAPSession *session;
+    g_return_val_if_fail(folder != NULL, -1);
+    g_return_val_if_fail(folder->type == F_IMAP, -1);
+    g_return_val_if_fail(msginfo != NULL, -1);
+    session = imap_session_get(folder);
+    if (!session) return -1;
+    debug_print(_("imap_do_unmark(): Message %s/%d is unmarked . %d\n"), msginfo->folder->path, msginfo->msgnum, folder->type);
+    imap_set_message_flags(session, msginfo->msgnum, msginfo->msgnum, IMAP_FLAG_FLAGGED, FALSE);
+}
+
+gint imap_do_reply        (MsgInfo    *msginfo)
+{
+    Folder     *folder = msginfo->folder->folder;
+    IMAPSession *session;
+    g_return_val_if_fail(folder != NULL, -1);
+    g_return_val_if_fail(folder->type == F_IMAP, -1);
+    g_return_val_if_fail(msginfo != NULL, -1);
+    session = imap_session_get(folder);
+    if (!session) return -1;
+    debug_print(_("imap_do_reply(): Message %s/%d is replied . %d\n"), msginfo->folder->path, msginfo->msgnum, folder->type);
+    imap_set_message_flags(session, msginfo->msgnum, msginfo->msgnum, IMAP_FLAG_ANSWERED, TRUE);
+}
+
 static gint imap_do_copy_msgs_with_dest(Folder *folder, FolderItem *dest, 
                                        GSList *msglist,
                                        gboolean remove_source)
index c7d78fe..3b95b44 100644 (file)
@@ -133,4 +133,8 @@ FolderItem *imap_create_folder              (Folder         *folder,
 gint imap_remove_folder                        (Folder         *folder,
                                         FolderItem     *item);
 
+gint imap_do_mark                      (MsgInfo        *msginfo);
+gint imap_do_unmark                    (MsgInfo        *msginfo);
+gint imap_do_reply                     (MsgInfo        *msginfo);
+
 #endif /* __IMAP_H__ */
index babb72c..c73f331 100644 (file)
@@ -2569,7 +2569,8 @@ static void summary_mark_row(SummaryView *summaryview, GtkCTreeNode *row)
        MSG_SET_PERM_FLAGS(msginfo->flags, MSG_MARKED);
        CHANGE_FLAGS(msginfo);
        summary_set_row_marks(summaryview, row);
-       debug_print(_("Message %d is marked\n"), msginfo->msgnum);
+       imap_do_mark(msginfo);
+       debug_print(_("Message %s/%d is marked\n"), msginfo->folder->path, msginfo->msgnum);
 }
 
 static void summary_lock_row(SummaryView *summaryview, GtkCTreeNode *row)
@@ -2861,7 +2862,7 @@ static void summary_unmark_row(SummaryView *summaryview, GtkCTreeNode *row)
        MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_MOVE | MSG_COPY);
        CHANGE_FLAGS(msginfo);
        summary_set_row_marks(summaryview, row);
-
+       imap_do_unmark(msginfo);
        debug_print(_("Message %s/%d is unmarked\n"),
                    msginfo->folder->path, msginfo->msgnum);
 }