2004-12-02 [colin] 0.9.12cvs179
authorColin Leroy <colin@colino.net>
Thu, 2 Dec 2004 07:57:26 +0000 (07:57 +0000)
committerColin Leroy <colin@colino.net>
Thu, 2 Dec 2004 07:57:26 +0000 (07:57 +0000)
* src/compose.c
Prevent duplicate edition of queued
and drafted mails

ChangeLog.claws
PATCHSETS
configure.ac
src/compose.c

index 0dbd38d..058085b 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-02 [colin]     0.9.12cvs179
+
+       * src/compose.c
+               Prevent duplicate edition of queued
+               and drafted mails
+
 2004-12-02 [colin]     0.9.12cvs178
 
        * src/compose.c
index 7cff1f8..eb620bd 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.252 -r 1.253 src/folderview.c; ) > 0.9.12cvs176.patchset
 ( cvs diff -u -r 1.16 -r 1.17 src/gtk/prefswindow.c; cvs diff -u -r 1.8 -r 1.9 src/gtk/pluginwindow.c; ) > 0.9.12cvs177.patchset
 ( cvs diff -u -r 1.458 -r 1.459 src/compose.c; ) > 0.9.12cvs178.patchset
+( cvs diff -u -r 1.459 -r 1.460 src/compose.c; ) > 0.9.12cvs179.patchset
index efbb8bd..5dc1ee1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=178
+EXTRA_VERSION=179
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index c0e926f..13f4e79 100644 (file)
@@ -675,6 +675,29 @@ static GtkTargetEntry compose_mime_types[] =
        {"text/uri-list", 0, 0}
 };
 
+static gboolean compose_put_existing_to_front(MsgInfo *info)
+{
+       GList *compose_list = compose_get_compose_list();
+       GList *elem = NULL;
+       
+       if (compose_list) {
+               for (elem = compose_list; elem != NULL && elem->data != NULL; 
+                    elem = elem->next) {
+                       Compose *c = (Compose*)elem->data;
+
+                       if (!c->targetinfo || !c->targetinfo->msgid ||
+                           !info->msgid)
+                               continue;
+
+                       if (!strcmp(c->targetinfo->msgid, info->msgid)) {
+                               gtkut_window_popup(c->window);
+                               return TRUE;
+                       }
+               }
+       }
+       return FALSE;
+}
+
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
                     GPtrArray *attach_files)
 {
@@ -1206,6 +1229,9 @@ void compose_reedit(MsgInfo *msginfo)
        g_return_if_fail(msginfo != NULL);
        g_return_if_fail(msginfo->folder != NULL);
 
+       if (compose_put_existing_to_front(msginfo)) 
+               return;
+
         if (msginfo->folder->stype == F_QUEUE || msginfo->folder->stype == F_DRAFT) {
                gchar queueheader_buf[BUFFSIZE];
                gint id, param;