Updating branch refs/heads/master
to 4165cf1443e4e90d936b91981bd8fe35367cc951 (commit)
from b5d8c292c2454d19d741d8035e381d05ba579485 (commit)
commit 4165cf1443e4e90d936b91981bd8fe35367cc951
Author: Christian Dywan <[email protected]>
Date: Sat Jul 3 20:41:07 2010 +0200
Strip mailto: prefix when parsing addresses
postler/postler-messages.vala | 2 ++
tests/parsing.vala | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index 52e260e..0350347 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -312,6 +312,8 @@ public class Postler.Messages : Gtk.TreeView {
lower--;
string recipient = address.slice (lower + 1, greater);
+ if (recipient.has_prefix ("mailto:"))
+ recipient = recipient.substring (7, -1);
if (lower == 0)
return { recipient, recipient };
/* TODO: Parse multiple addresses */
diff --git a/tests/parsing.vala b/tests/parsing.vala
index a8189b1..febe057 100644
--- a/tests/parsing.vala
+++ b/tests/parsing.vala
@@ -45,6 +45,7 @@ const TestCase[] addresses = {
{ "Klaus", null },
{ "[email protected]", null },
{ "<[email protected]>", "[email protected] [email protected]" },
+ { "<mailto:[email protected]>", "[email protected] [email protected]" },
{ "'Klaus' <[email protected]>", "Klaus [email protected]" },
{ "\"Klaus\" <[email protected]>", "Klaus [email protected]" },
{ "=?iso-8859-1?Q?M=2C_Alf?= <[email protected]>",
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits