Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jberkman
evolution-data-server-2.6
bnc-266279-notes-meeting-appearing-in-view.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-266279-notes-meeting-appearing-in-view.diff of Package evolution-data-server-2.6
Index: calendar/backends/groupwise/e-cal-backend-groupwise.c =================================================================== --- calendar/backends/groupwise/e-cal-backend-groupwise.c (revision 7683) +++ calendar/backends/groupwise/e-cal-backend-groupwise.c (working copy) @@ -1798,6 +1798,58 @@ g_string_free (str, TRUE); } +static gboolean +is_user_attendee (ECalBackendGroupwise *cbgw, ECalComponent *comp) +{ + icalcomponent *icalcomp; + icalproperty *icalprop; + + icalcomp = e_cal_component_get_icalcomponent (comp); + if (e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_JOURNAL) { + + for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); icalprop; + icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) { + if (g_str_equal (icalproperty_get_x_name (icalprop), "X-EVOLUTION-RECIPIENTS")) { + break; + } + } + + if (icalprop) { + const char *attendees = NULL; + char **emails, **iter; + + attendees = icalproperty_get_x (icalprop); + emails = g_strsplit (attendees, ";", -1); + + iter = emails; + while (*iter) { + if (!g_ascii_strcasecmp (*iter, cbgw->priv->user_email)) { + g_strfreev (emails); + return TRUE; + } + iter++; + } + + g_strfreev (emails); + } + } else { + GSList *attendee_list = NULL, *al; + + e_cal_component_get_attendee_list (comp, &attendee_list); + for (al = attendee_list; al != NULL; al = al->next) { + ECalComponentAttendee *attendee = (ECalComponentAttendee *) al->data; + + if (!g_ascii_strcasecmp (attendee->value + 7, cbgw->priv->user_email)) { + e_cal_component_free_attendee_list (attendee_list); + return TRUE; + } + } + e_cal_component_free_attendee_list (attendee_list); + } + return FALSE; +} + + static ECalBackendSyncStatus e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid) { @@ -1808,6 +1859,7 @@ EGwConnectionStatus status; char *server_uid = NULL; GSList *uid_list = NULL, *l; + gboolean store_comp_in_cache = FALSE; int i; cbgw = E_CAL_BACKEND_GROUPWISE (backend); @@ -1838,6 +1890,9 @@ switch (priv->mode) { case CAL_MODE_ANY : case CAL_MODE_REMOTE : + if (e_cal_component_has_organizer (comp) && is_user_attendee (cbgw, comp)) + store_comp_in_cache = TRUE; + /* when online, send the item to the server */ status = e_gw_connection_create_appointment (priv->cnc, priv->container_id, cbgw, comp, &uid_list); @@ -1854,7 +1909,7 @@ } /* If delay deliver has been set, server will not send the uid */ - if (!uid_list || ((e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_JOURNAL) && e_cal_component_has_organizer (comp))) { + if (!uid_list || (e_cal_component_has_organizer (comp) && !store_comp_in_cache)) { *calobj = NULL; g_object_unref (comp); return GNOME_Evolution_Calendar_Success;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor