summaryrefslogtreecommitdiff
path: root/extra/evolution-data-server/fix-google-2fa-3.patch
blob: a5c6ca324655f1d471748eb34fc0c16e957c42de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From cc9fb7d15ce3983fc36487d2856e5fd14b341725 Mon Sep 17 00:00:00 2001
From: Matthew Barnes <mbarnes@redhat.com>
Date: Tue, 09 Jul 2013 15:49:09 +0000
Subject: google: Minor module cleanups.

---
diff --git a/modules/google-backend/module-google-backend.c b/modules/google-backend/module-google-backend.c
index d5684bb..cbd7bd2 100644
--- a/modules/google-backend/module-google-backend.c
+++ b/modules/google-backend/module-google-backend.c
@@ -100,19 +100,17 @@ google_backend_contacts_update_auth_method (ESource *source)
 	EOAuth2Support *oauth2_support;
 	ESourceAuthentication *extension;
 	const gchar *extension_name;
-
-	extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
-	extension = e_source_get_extension (source, extension_name);
+	const gchar *method;
 
 	oauth2_support = e_server_side_source_ref_oauth2_support (
 		E_SERVER_SIDE_SOURCE (source));
-	if (oauth2_support != NULL) {
-		e_source_authentication_set_method (extension, "OAuth2");
-		g_object_unref (oauth2_support);
-		return;
-	}
 
-	e_source_authentication_set_method (extension, "ClientLogin");
+	extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
+	extension = e_source_get_extension (source, extension_name);
+	method = (oauth2_support != NULL) ? "OAuth2" : "ClientLogin";
+	e_source_authentication_set_method (extension, method);
+
+	g_clear_object (&oauth2_support);
 }
 
 static void
@@ -178,7 +176,8 @@ google_backend_add_calendar (ECollectionBackend *backend)
 
 		g_get_current_time (&today_tv);
 		today = g_time_val_to_iso8601 (&today_tv);
-		e_source_alarms_set_last_notified (E_SOURCE_ALARMS (extension), today);
+		e_source_alarms_set_last_notified (
+			E_SOURCE_ALARMS (extension), today);
 		g_free (today);
 	}