[Xfce4-commits] <postler:master> Only look for a secondary mailer name if it is Mozilla
Christian Dywan
noreply at xfce.org
Tue Jul 13 00:54:01 CEST 2010
Updating branch refs/heads/master
to 19d52ce696eb114f6296a8cf835fd797a12968f9 (commit)
from 49fe6c8d8021337ce195be15708d90a2574ff2a9 (commit)
commit 19d52ce696eb114f6296a8cf835fd797a12968f9
Author: Christian Dywan <christian at twotoasts.de>
Date: Sat Jul 3 20:15:11 2010 +0200
Only look for a secondary mailer name if it is Mozilla
postler/postler-content.vala | 4 ++--
tests/parsing.vala | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 63e782f..bda69d8 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -109,7 +109,7 @@ public class Postler.Content : WebKit.WebView {
internal static string format_x_mailer (string x_mailer) {
string mailer = x_mailer.chomp ();
- if (") " in mailer)
+ if (mailer.has_prefix ("Mozilla/") && ") " in mailer)
return mailer.rchr (-1, ' ').chug ().replace ("/", " ");
int bracket = 0;
@@ -117,7 +117,7 @@ public class Postler.Content : WebKit.WebView {
bracket++;
if (mailer[bracket] == '\0')
return mailer;
- return mailer.substring (0, bracket).chomp ();
+ return mailer.substring (0, bracket).chomp ().replace ("/", " ");
}
static string html_escape (string unescaped) {
diff --git a/tests/parsing.vala b/tests/parsing.vala
index bba7015..a8189b1 100644
--- a/tests/parsing.vala
+++ b/tests/parsing.vala
@@ -90,7 +90,8 @@ const TestCase[] mailers = {
{ "Apple Mail (2.936)", "Apple Mail" },
{ "Evolution 2.30.1 ", "Evolution 2.30.1" },
{ "Evolution 2.28.3 (2.28.3-1.fc12) ", "Evolution 2.28.3" },
- { "Mozilla/5.0 (X11; U) Gecko/201 Thunderbird/3.0.4", "Thunderbird 3.0.4" }
+ { "Mozilla/5.0 (X11; U) Gecko/201 Thunderbird/3.0.4", "Thunderbird 3.0.4" },
+ { "postler/0.0.1-6d417e0 (X11; U) WebKit/531.2+", "postler 0.0.1-6d417e0" }
};
void parsing_headers_mailer () {
More information about the Xfce4-commits
mailing list