[PATCH] Attachments in mailto: URLs



I noticed when trying to mail pictures from f-spot that Balsa didn't
include the attachments. A bit of digging revealed that the reason is that
Balsa doesn't understand things like
"mailto:helmut example com?attach=/tmp/strudel.jpg"

I hacked up a small patch for this, included below. In case it suffers
from whitespace damage, it's also available at
http://nullinfinity.org/attach.patch .

Regards,

Johan

--- origbalsa/src/sendmsg-window.c      2006-10-08 08:52:03.000000000 -0700
+++ balsa/src/sendmsg-window.c  2006-10-31 19:59:41.000000000 -0800
@@ -4596,8 +4596,12 @@
        key = decode_and_strdup(ptr,'=', &ptr);
        if(ptr) {
            val = decode_and_strdup(ptr,'&', &ptr);
-           func(data, key, val);
-           g_free(val);
+            if (g_ascii_strcasecmp(key, "attach") == 0)
+                add_attachment(data,val,FALSE,NULL);
+           else {
+                func(data, key, val);
+                g_free(val);
+            }
        }
        g_free(key);
     }




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]