[evolution] I#1090 - Forward as iCalendar: Embed event's local attachments



commit e91ea32b9dfc455e946d45942a18f34401bb5215
Author: Milan Crha <mcrha redhat com>
Date:   Mon Sep 14 15:50:20 2020 +0200

    I#1090 - Forward as iCalendar: Embed event's local attachments
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1090

 src/calendar/gui/itip-utils.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/src/calendar/gui/itip-utils.c b/src/calendar/gui/itip-utils.c
index daa88807a4..d5b39897c9 100644
--- a/src/calendar/gui/itip-utils.c
+++ b/src/calendar/gui/itip-utils.c
@@ -2010,6 +2010,8 @@ itip_send_component_begin (ItipSendComponentData *isc,
                           GCancellable *cancellable,
                           GError **error)
 {
+       GSList *link;
+
        g_return_if_fail (isc != NULL);
 
        isc->completed = FALSE;
@@ -2038,6 +2040,24 @@ itip_send_component_begin (ItipSendComponentData *isc,
                }
        }
 
+       for (link = isc->send_comps; link; link = g_slist_next (link)) {
+               ECalComponent *comp = link->data;
+
+               if (comp && e_cal_component_has_attachments (comp)) {
+                       ECalComponent *clone;
+
+                       clone = e_cal_component_clone (comp);
+                       g_object_unref (comp);
+
+                       link->data = clone;
+
+                       if (!e_cal_util_inline_local_attachments_sync (e_cal_component_get_icalcomponent 
(clone), cancellable, error)) {
+                               isc->success = FALSE;
+                               return;
+                       }
+               }
+       }
+
        /* Give the server a chance to manipulate the comp */
        if (isc->method != E_CAL_COMPONENT_METHOD_PUBLISH) {
                d (printf ("itip-utils.c: itip_send_component_begin: calling comp_server_send_sync... \n"));


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