[Xfce4-commits] <postler:master> Show Unsucribe in extra headers if present
Christian Dywan
noreply at xfce.org
Tue Jan 4 05:52:05 CET 2011
Updating branch refs/heads/master
to 2ce5d76c62e48b4e0a6b0ec00d427c329ddbf5c6 (commit)
from 9a2e625095aa339145bcdd9df70c7da3d0a77a72 (commit)
commit 2ce5d76c62e48b4e0a6b0ec00d427c329ddbf5c6
Author: Christian Dywan <christian at twotoasts.de>
Date: Mon Jan 3 16:49:13 2011 +0100
Show Unsucribe in extra headers if present
Many Users find it hard to unsubscribe from mailing lists.
postler/postler-content.vala | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index b205c5c..6b3db4a 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -90,6 +90,7 @@ public class Postler.Content : WebKit.WebView {
public string? reply_to { get; set; }
public string? reply_to_all { get; set; }
public string list_post { get; set; }
+ public string list_unsubscribe { get; set; }
public unowned List<MessagePart> message_parts { public get; set; }
public MessagePart? current_part { get; private set; }
@@ -584,6 +585,7 @@ public class Postler.Content : WebKit.WebView {
/* TODO: blind_copy, some clients keep it */
reply = "";
list_post = "";
+ list_unsubscribe = "";
organization = "";
x_mailer = "";
string previous_line = "";
@@ -634,6 +636,11 @@ public class Postler.Content : WebKit.WebView {
list_post = parse_encoded (parts[1], out list_post_charset);
list_post = Postler.Messages.parse_address (list_post)[1];
}
+ else if (field == "list-unsubscribe") {
+ string list_unsubscribe_charset = null;
+ list_unsubscribe = parse_encoded (parts[1], out list_unsubscribe_charset);
+ list_unsubscribe = Postler.Messages.parse_address (list_unsubscribe)[1];
+ }
else if (field == "organization")
organization = parts[1];
else if (field == "x-mailer" || field == "user-agent")
@@ -675,6 +682,8 @@ public class Postler.Content : WebKit.WebView {
carbon_copy = linkify_address (carbon_copy, arguments);
if (reply != "")
reply = linkify_address (reply, arguments);
+ if (list_unsubscribe != "")
+ list_unsubscribe = linkify_address (list_unsubscribe, null);
parse_body (stream, content_type, ref charset);
} catch (GLib.Error contents_error) {
@@ -958,6 +967,7 @@ public class Postler.Content : WebKit.WebView {
%s
%s
%s
+ %s
</span>
</span>
<p class="body" style="%s">%s</p>
@@ -974,6 +984,7 @@ public class Postler.Content : WebKit.WebView {
format_header (_("Reply To:"), reply),
format_header (_("Organization:"), organization),
format_header (_("Application:"), x_mailer),
+ format_header (_("Unsubscribe:"), list_unsubscribe),
message_part.plain_text ? "font-family: Monospace;" : "",
body_chunk),
mime_type, "UTF-8", "about:blank");
More information about the Xfce4-commits
mailing list