[geary/mjog/info-bar-cleanup: 50/50] Application.Controller: Minor code cleanup for readability



commit e0ac053f33441cdd12d2070bb4239f150b269272
Author: Michael Gratton <mike vee net>
Date:   Tue Mar 17 17:19:54 2020 +1100

    Application.Controller: Minor code cleanup for readability

 src/client/application/application-controller.vala | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/client/application/application-controller.vala 
b/src/client/application/application-controller.vala
index 4a149596..2be8537e 100644
--- a/src/client/application/application-controller.vala
+++ b/src/client/application/application-controller.vala
@@ -1760,16 +1760,14 @@ internal class Application.AccountContext : Geary.BaseObject {
             effective |= ONLINE;
         }
         if (current.has_service_problem()) {
-            // Only retain this flag if the problem isn't auth or
-            // cert related, that is handled elsewhere.
-            Geary.ClientService.Status incoming =
-            account.incoming.current_status;
-            Geary.ClientService.Status outgoing =
-            account.outgoing.current_status;
-            if (incoming != AUTHENTICATION_FAILED &&
-                incoming != TLS_VALIDATION_FAILED &&
-                outgoing != AUTHENTICATION_FAILED &&
-                outgoing != TLS_VALIDATION_FAILED) {
+            // Only retain service problem if the problem isn't auth
+            // or cert related, that is handled elsewhere.
+            const Geary.ClientService.Status SPECIALS[] = {
+                AUTHENTICATION_FAILED,
+                TLS_VALIDATION_FAILED
+            };
+            if (!(account.incoming.current_status in SPECIALS) &&
+                !(account.outgoing.current_status in SPECIALS)) {
                 effective |= SERVICE_PROBLEM;
             }
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]