diff options
-rw-r--r-- | calendar/gui/itip-utils.c | 88 | ||||
-rw-r--r-- | calendar/gui/itip-utils.h | 5 |
2 files changed, 0 insertions, 93 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 819fc897c3..a208ff4f42 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -2154,94 +2154,6 @@ comp_fb_normalize (icalcomponent *icomp) return iclone; } -gboolean -itip_publish_comp (ECalClient *cal_client, - gchar *uri, - gchar *username, - gchar *password, - ECalComponent **pub_comp) -{ - icalcomponent *toplevel = NULL, *icalcomp = NULL; - icalcomponent *icomp = NULL; - SoupSession *session; - SoupMessage *msg; - SoupURI *real_uri; - gchar *ical_string = NULL; - EProxy *proxy; - - toplevel = e_cal_util_new_top_level (); - icalcomponent_set_method (toplevel, ICAL_METHOD_PUBLISH); - - e_cal_component_set_url (*pub_comp, uri); - - icalcomp = e_cal_component_get_icalcomponent (*pub_comp); - - icomp = comp_fb_normalize (icalcomp); - - icalcomponent_add_component (toplevel, icomp); - - /* Publish the component */ - session = soup_session_new (); - g_object_set (session, SOUP_SESSION_TIMEOUT, 90, NULL); - - proxy = e_proxy_new (); - e_proxy_setup_proxy (proxy); - - if (e_proxy_require_proxy_for_uri (proxy, uri)) { - SoupURI *proxy_uri; - - proxy_uri = e_proxy_peek_uri_for (proxy, uri); - - g_object_set (session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); - } - - g_clear_object (&proxy); - - real_uri = soup_uri_new (uri); - if (!real_uri || !real_uri->host) { - g_warning (G_STRLOC ": Invalid URL: %s", uri); - g_object_unref (session); - return FALSE; - } - - soup_uri_set_user (real_uri, username); - soup_uri_set_password (real_uri, password); - - /* build the message */ - msg = soup_message_new_from_uri (SOUP_METHOD_PUT, real_uri); - soup_uri_free (real_uri); - if (!msg) { - g_warning (G_STRLOC ": Could not build SOAP message"); - g_object_unref (session); - return FALSE; - } - - soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); - ical_string = icalcomponent_as_ical_string_r (toplevel); - soup_message_set_request ( - msg, "text/calendar", SOUP_MEMORY_TEMPORARY, - ical_string, strlen (ical_string)); - - /* send message to server */ - soup_session_send_message (session, msg); - if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { - g_warning ( - G_STRLOC ": Could not publish Free/Busy: %d: %s", - msg->status_code, - msg->reason_phrase); - g_object_unref (msg); - g_object_unref (session); - g_free (ical_string); - return FALSE; - } - - g_object_unref (msg); - g_object_unref (session); - g_free (ical_string); - - return TRUE; -} - static gboolean check_time (const struct icaltimetype tmval, gboolean can_null_time) diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h index 5c3ed3b9e5..dee2b35765 100644 --- a/calendar/gui/itip-utils.h +++ b/calendar/gui/itip-utils.h @@ -78,11 +78,6 @@ gboolean itip_send_comp (ESourceRegistry *registry, GSList *users, gboolean strip_alarms, gboolean only_new_attendees); -gboolean itip_publish_comp (ECalClient *cal_client, - gchar *uri, - gchar *username, - gchar *password, - ECalComponent **pub_comp); gboolean itip_publish_begin (ECalComponent *pub_comp, ECalClient *cal_client, gboolean cloned, |