diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/caldav/caldav-source.c | 55 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 8 |
2 files changed, 51 insertions, 12 deletions
diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index 5df807a691..e3d2c52ab4 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -79,6 +79,29 @@ e_plugin_lib_enable (EPluginLib *ep, int enable) return 0; } +/* replaces all '@' with '%40' in str; returns newly allocated string */ +static char * +replace_at_sign (const char *str) +{ + char *res, *at; + + if (!str) + return NULL; + + res = g_strdup (str); + while (at = strchr (res, '@'), at) { + char *tmp = g_malloc0 (sizeof (char) * (1 + strlen (res) + 2)); + + strncpy (tmp, res, at - res); + strcat (tmp, "%40"); + strcat (tmp, at + 1); + + g_free (res); + res = tmp; + } + + return res; +} /*****************************************************************************/ /* the location field for caldav sources */ @@ -87,17 +110,27 @@ e_plugin_lib_enable (EPluginLib *ep, int enable) static gchar * print_uri_noproto (EUri *uri) { - gchar *uri_noproto; + gchar *uri_noproto, *user, *pass; + + if (uri->user) + user = replace_at_sign (uri->user); + else + user = NULL; + + if (uri->passwd) + pass = replace_at_sign (uri->passwd); + else + pass = NULL; if (uri->port != 0) uri_noproto = g_strdup_printf ( "%s%s%s%s%s%s%s:%d%s%s%s", - uri->user ? uri->user : "", + user ? user : "", uri->authmech ? ";auth=" : "", uri->authmech ? uri->authmech : "", - uri->passwd ? ":" : "", - uri->passwd ? uri->passwd : "", - uri->user ? "@" : "", + pass ? ":" : "", + pass ? pass : "", + user ? "@" : "", uri->host ? uri->host : "", uri->port, uri->path ? uri->path : "", @@ -106,16 +139,20 @@ print_uri_noproto (EUri *uri) else uri_noproto = g_strdup_printf ( "%s%s%s%s%s%s%s%s%s%s", - uri->user ? uri->user : "", + user ? user : "", uri->authmech ? ";auth=" : "", uri->authmech ? uri->authmech : "", - uri->passwd ? ":" : "", - uri->passwd ? uri->passwd : "", - uri->user ? "@" : "", + pass ? ":" : "", + pass ? pass : "", + user ? "@" : "", uri->host ? uri->host : "", uri->path ? uri->path : "", uri->query ? "?" : "", uri->query ? uri->query : ""); + + g_free (user); + g_free (pass); + return uri_noproto; } diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 25d02b4f5d..c777f6cbb5 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -629,8 +629,8 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) e_cal_free_object_list (objects); } - - if (!pitip->current_ecal && e_cal_get_object (ecal, fd->uid, fd->rid, &icalcomp, NULL)) { + /* search for a master object if the detached object doesn't exist in the calendar */ + if (!pitip->current_ecal && (e_cal_get_object (ecal, fd->uid, fd->rid, &icalcomp, NULL) || (fd->rid && e_cal_get_object (ecal, fd->uid, NULL, &icalcomp, NULL)))) { if ((pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) && (icalcomponent_get_first_component (icalcomp, ICAL_VALARM_COMPONENT) || icalcomponent_get_first_component (icalcomp, ICAL_XAUDIOALARM_COMPONENT) || @@ -1278,7 +1278,9 @@ update_attendee_status (struct _itip_puri *pitip) org_icalcomp = e_cal_component_get_icalcomponent (pitip->comp); rid = e_cal_component_get_recurid_as_string (pitip->comp); - if (e_cal_get_object (pitip->current_ecal, uid, rid, &icalcomp, NULL)) { + + /* search for a master object if the detached object doesn't exist in the calendar */ + if (e_cal_get_object (pitip->current_ecal, uid, rid, &icalcomp, NULL) || (rid && e_cal_get_object (pitip->current_ecal, uid, NULL, &icalcomp, NULL))) { GSList *attendees; comp = e_cal_component_new (); |