[evolution-data-server] GOA Google Calendar - Do not notify about past events



commit 38077cfb6aa4976b30efc901852b3323611c68dd
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 30 14:44:23 2015 +0200

    GOA Google Calendar - Do not notify about past events
    
    I accidentally removed the code when I was adding the calendar discovery.

 modules/google-backend/module-google-backend.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/modules/google-backend/module-google-backend.c b/modules/google-backend/module-google-backend.c
index 8e91a62..e7ba856 100644
--- a/modules/google-backend/module-google-backend.c
+++ b/modules/google-backend/module-google-backend.c
@@ -648,6 +648,20 @@ google_backend_child_added (ECollectionBackend *backend,
         *     Many-to-one property bindinds tend not to work so well. */
        extension_name = E_SOURCE_EXTENSION_CALENDAR;
        if (e_source_has_extension (child_source, extension_name)) {
+               ESourceAlarms *alarms_extension;
+
+               /* To not notify about past reminders. */
+               alarms_extension = e_source_get_extension (child_source, E_SOURCE_EXTENSION_ALARMS);
+               if (!e_source_alarms_get_last_notified (alarms_extension)) {
+                       GTimeVal today_tv;
+                       gchar *today;
+
+                       g_get_current_time (&today_tv);
+                       today = g_time_val_to_iso8601 (&today_tv);
+                       e_source_alarms_set_last_notified (alarms_extension, today);
+                       g_free (today);
+               }
+
                google_backend_calendar_update_auth_method (child_source);
                g_signal_connect (
                        child_source, "notify::oauth2-support",


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