* src/compose.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 18 Jul 2003 22:42:05 +0000 (22:42 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 18 Jul 2003 22:42:05 +0000 (22:42 +0000)
* src/common/utils.c
honour #240 "Better SUBJECT handling" by cleaning the prefix
for both forwarding as replying

ChangeLog.claws
configure.ac
src/common/utils.c
src/compose.c

index 1330c0a..b5d2840 100644 (file)
@@ -1,3 +1,10 @@
+2003-07-19 [alfons]    0.9.3claws26
+
+       * src/compose.c
+       * src/common/utils.c
+               honour #240 "Better SUBJECT handling" by cleaning the prefix
+               for both forwarding as replying
+
 2003-07-18 [christoph] 0.9.3claws25
 
        * configure.ac
index ab1ab58..4915004 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=25
+EXTRA_VERSION=26
 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws${EXTRA_VERSION}
 
 dnl set $target
index eab6c96..dd29497 100644 (file)
@@ -3297,7 +3297,8 @@ int subject_get_reply_prefix_length(const gchar *subject)
                "Antw\\:",                      /* "Antw:" (Dutch / German Outlook) */
                "Aw\\:",                        /* "Aw:"   (German) */
                "Antwort\\:",                   /* "Antwort:" (German Lotus Notes) */
-               "Res\\:"                        /* "Res:" (Brazilian Outlook) */
+               "Res\\:",                       /* "Res:" (Brazilian Outlook) */
+               "Fw\\:"                         /* "Fw:" Forward */
                /* add more */
        };
        const int REPLY_PREFIXES = sizeof reply_prefixes / sizeof reply_prefixes[0];
index 4d8c21a..976f71d 100644 (file)
@@ -1038,9 +1038,17 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                compose->fwdinfo = procmsg_msginfo_copy(msginfo);
 
        if (msginfo->subject && *msginfo->subject) {
-               gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), "Fw: ");
-               gtk_entry_append_text(GTK_ENTRY(compose->subject_entry),
-                                     msginfo->subject);
+               gchar *buf, *buf2, *p;
+
+               buf = p = g_strdup(msginfo->subject);
+               p += subject_get_reply_prefix_length(p);
+               memmove(buf, p, strlen(p) + 1);
+
+               buf2 = g_strdup_printf("Fw: %s", buf);
+               gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), buf2);
+               
+               g_free(buf);
+               g_free(buf2);
        }
 
        text = GTK_STEXT(compose->text);