[Xfce4-commits] <postler:master> Use PSTL/ error message syntax for writing mbsyncrc

Christian Dywan noreply at xfce.org
Tue Sep 6 01:22:03 CEST 2011


Updating branch refs/heads/master
         to 49fd9eb01a8cc100e231609c7db40a05e5465687 (commit)
       from dfc7a819e72efeb89efdc81e5e866584ff7f0d38 (commit)

commit 49fd9eb01a8cc100e231609c7db40a05e5465687
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Aug 17 20:04:19 2011 +0200

    Use PSTL/ error message syntax for writing mbsyncrc
    
    If the system has no root certificate file, it should be treated the
    same as if the specific certificate is missing.
    
    Errors in the account data should always show up in the UI.

 postler/postler-accounts.vala |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/postler/postler-accounts.vala b/postler/postler-accounts.vala
index d186f8b..6347944 100644
--- a/postler/postler-accounts.vala
+++ b/postler/postler-accounts.vala
@@ -458,7 +458,8 @@ public class Postler.Accounts : GLib.Object {
             return "%s/%s.mbsyncrc".printf (cache_path, info.name);
         case AccountType.MAILDIR:
         case AccountType.SEARCH:
-            throw new GLib.FileError.FAILED (_("This type can't receive mail."));
+            throw new GLib.FileError.FAILED (
+                _("Account \"%s\" can't receive mail."), info.name);
         }
         return null;
     }
@@ -474,13 +475,13 @@ public class Postler.Accounts : GLib.Object {
         if (account_file_status.st_mtime < filename_status.st_mtime)
             return filename;
 
-        if (certificate_file == null)
-            throw new GLib.FileError.FAILED (_("No SSL certificates available"));
+        if (certificate_file == null && !info.unverified)
+            throw new GLib.FileError.FAILED ("PSTL/CERT/No SSL certificates available");
 
         if (info.address != null) {
             string[] address_parts = info.address.split_set ("@,", 3);
             if (address_parts[0] == null || address_parts[1] == null)
-                throw new GLib.FileError.FAILED (_("Invalid address"));
+                throw new GLib.FileError.FAILED ("PSTL/LOGIN/Invalid address");
             if (send == null && info.receive == null)
                 info.receive = "imap." + address_parts[1];
             if (send != null && info.send == null)
@@ -490,13 +491,13 @@ public class Postler.Accounts : GLib.Object {
         }
 
         if (send == null && info.receive == null)
-            throw new GLib.FileError.FAILED (_("Hostname is missing"));
+            throw new GLib.FileError.FAILED ("PSTL/LOGIN/Hostname is missing");
         if (send != null && info.send == null)
-            throw new GLib.FileError.FAILED (_("Hostname is missing"));
+            throw new GLib.FileError.FAILED ("PSTL/LOGIN/Hostname is missing");
         if (info.username == null)
-            throw new GLib.FileError.FAILED (_("Username is missing"));
+            throw new GLib.FileError.FAILED ("PSTL/LOGIN/Username is missing");
         if (info.password == null)
-            throw new GLib.FileError.FAILED (_("Password is missing"));
+            throw new GLib.FileError.FAILED ("PSTL/LOGIN/Password is missing");
         string certificate = info.certificate;
         if (certificate != null && !Path.is_absolute (certificate))
             certificate = info.path + "/" + certificate;
@@ -564,7 +565,7 @@ public class Postler.Accounts : GLib.Object {
                    Pass "%s"
                    Path "%s"
                    UseIMAPS yes
-                   CertificateFile %s
+                   %s %s
                    %s %s
 
                MaildirStore local
@@ -587,7 +588,8 @@ public class Postler.Accounts : GLib.Object {
                    info.username,
                    info.password,
                    info.prefix != null ? info.prefix + "." : "",
-                   certificate_file,
+                   certificate_file != null ? "CertificateFile" : "",
+                   certificate_file != null ? certificate_file : "",
                    certificate != null ? "CertificateFile" : "",
                    certificate != null ? certificate : "",
                    info.path,


More information about the Xfce4-commits mailing list