[Xfce4-commits] <postler:master> Recognize Facebook, Google+ and Twitter as notifications

Christian Dywan noreply at xfce.org
Thu Jul 14 02:02:02 CEST 2011


Updating branch refs/heads/master
         to 75a65176e3a58a959ef7e8c740b4dd9621e2ec8a (commit)
       from 3a9d4cc427d2be910c1fbfa6f47ea117f825f510 (commit)

commit 75a65176e3a58a959ef7e8c740b4dd9621e2ec8a
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Jul 13 20:07:41 2011 +0200

    Recognize Facebook, Google+ and Twitter as notifications
    
    Unfortunately there's no standard header whatsoever.

 postler/postler-message.vala |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/postler/postler-message.vala b/postler/postler-message.vala
index 1cd7b55..4630e43 100644
--- a/postler/postler-message.vala
+++ b/postler/postler-message.vala
@@ -330,6 +330,8 @@ namespace Postler {
                     fields.insert (field, parse_encoded (parts[1], out sender_charset));
                     if (sender == null)
                         sender = get_field (field);
+                    if (sender.has_suffix ("@postmaster.twitter.com"))
+                        project = "Twitter";
                 }
                 else if (field == "x-bugzilla-who") {
                     string sender_charset = null;
@@ -365,8 +367,10 @@ namespace Postler {
                     if (field == "x-launchpad-bug")
                         can_reply_personally = false;
                 }
-                else if (field == "x-notification-id")
-                    fields.insert (field, parts[1]);
+                else if (field == "x-facebook-notify")
+                    project = "Facebook";
+                else if (field == "x-notification-id" && sender.has_suffix ("@plus.google.com"))
+                    project = "Google+";
                 else if (field == "list-id") {
                     string field_charset = null;
                     list = parse_encoded (parts[1], out field_charset);
@@ -389,16 +393,6 @@ namespace Postler {
 
             recipients = parse_encoded (recipients, out charset);
 
-            /* For X-Notification-ID the sender or domain is the product name */
-            if (project == null && get_field ("x-notification-id") != null) {
-                string address = Postler.Contact.address_from_string (sender);
-                string? domain = address.rstr ("@");
-                if (domain != null)
-                    project = domain.next_char ();
-                else
-                    project = address;
-            }
-
             /* Some mailing list systems override Reply-To so that it doesn't
                point to the author but the list.
                Also Reply-To may equal From, which is at best confusing. */



More information about the Xfce4-commits mailing list