[evolution-data-server/gnome-3-30] [CalDAV/CardDAV] Can add component to local cache with incomplete info



commit 45866245fab2bb4f1a3fda86027df99756f64bd8
Author: Milan Crha <mcrha redhat com>
Date:   Mon Nov 26 12:07:42 2018 +0100

    [CalDAV/CardDAV] Can add component to local cache with incomplete info
    
    When a component/contact is loaded from the server when it's not part
    of the local cache (which can happen for example with meeting invitations),
    then the fetched object was stored without the href in the local cache,
    which made it impossible to edit the object later (it resulted
    in an "Invalid Object" error).

 src/addressbook/backends/carddav/e-book-backend-carddav.c | 2 ++
 src/calendar/backends/caldav/e-cal-backend-caldav.c       | 2 ++
 2 files changed, 4 insertions(+)
---
diff --git a/src/addressbook/backends/carddav/e-book-backend-carddav.c 
b/src/addressbook/backends/carddav/e-book-backend-carddav.c
index b2afae39a..d8db87031 100644
--- a/src/addressbook/backends/carddav/e-book-backend-carddav.c
+++ b/src/addressbook/backends/carddav/e-book-backend-carddav.c
@@ -1038,6 +1038,8 @@ ebb_carddav_load_contact_sync (EBookMetaBackend *meta_backend,
                                g_propagate_error (&local_error, EDB_ERROR_EX 
(E_DATA_BOOK_STATUS_OTHER_ERROR, _("Server didn’t return object’s ETag")));
                        else
                                g_propagate_error (&local_error, EDB_ERROR_EX 
(E_DATA_BOOK_STATUS_OTHER_ERROR, _("Received object is not a valid vCard")));
+               } else if (out_extra) {
+                       *out_extra = g_strdup (href);
                }
        }
 
diff --git a/src/calendar/backends/caldav/e-cal-backend-caldav.c 
b/src/calendar/backends/caldav/e-cal-backend-caldav.c
index bdeb3e58f..18a2cd09a 100644
--- a/src/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/src/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -1194,6 +1194,8 @@ ecb_caldav_load_component_sync (ECalMetaBackend *meta_backend,
                                g_propagate_error (&local_error, EDC_ERROR_EX (InvalidObject, _("Server 
didn’t return object’s ETag")));
                        else
                                g_propagate_error (&local_error, EDC_ERROR (InvalidObject));
+               } else if (out_extra) {
+                       *out_extra = g_strdup (href);
                }
        }
 


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