[evolution-ews] Remove e_ews_connection_get_oof_settings().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Remove e_ews_connection_get_oof_settings().
- Date: Wed, 18 Jul 2012 20:12:56 +0000 (UTC)
commit 2812c3c9611b4782d04ba84c331b438a5846fdfc
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Jul 18 15:04:34 2012 -0400
Remove e_ews_connection_get_oof_settings().
Use e_ews_oof_settings_new() instead.
src/server/e-ews-connection.c | 231 -----------------------------------------
src/server/e-ews-connection.h | 18 ---
2 files changed, 0 insertions(+), 249 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index c4a9093..58a8cf2 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -888,134 +888,6 @@ get_items_response_cb (ESoapResponse *response,
}
}
-static gchar *
-get_text_from_html (gchar *html_text)
-{
- gssize haystack_len = strlen (html_text);
- gchar *plain_text, *ret_text;
- gchar *start = g_strstr_len (html_text, haystack_len, "<body"),
- *end = g_strstr_len (html_text, haystack_len, "</body>"),
- *i, *j;
-
- /*parse the status set by owa*/
- if (g_strrstr (html_text, "BodyFragment") && !start) {
- start = html_text;
- end = html_text + haystack_len;
- }
-
- plain_text = g_malloc (end - start);
- i = start;
- for (j = plain_text; i < end; i++) {
- if (*i == '<') {
- while (*i != '>')
- i++;
- } else {
- *j = *i;
- j++;
- }
- }
-
- *j = '\0';
- ret_text = g_strdup (plain_text);
-
- g_free (html_text);
- g_free (plain_text);
-
- return ret_text;
-}
-
-static void
-get_oof_settings_response_cb (ESoapResponse *response,
- GSimpleAsyncResult *simple)
-{
- ESoapParameter *param;
- ESoapParameter *node, *node_1;
- EwsAsyncData *async_data;
- OOFSettings *oof_settings;
- gchar *state = NULL, *ext_aud = NULL;
- gchar *start_tm = NULL, *end_tm = NULL;
- gchar *ext_msg = NULL, *int_msg = NULL;
- GTimeVal time_val;
- GError *error = NULL;
-
- param = e_soap_response_get_first_parameter_by_name (
- response, "ResponseMessage", &error);
-
- /* Sanity check */
- g_return_if_fail (
- (param != NULL && error == NULL) ||
- (param == NULL && error != NULL));
-
- if (error != NULL) {
- g_simple_async_result_take_error (simple, error);
- return;
- }
-
- if (!ews_get_response_status (param, &error)) {
- g_simple_async_result_take_error (simple, error);
- return;
- }
-
- param = e_soap_response_get_first_parameter_by_name (
- response, "OofSettings", &error);
-
- /* Sanity check */
- g_return_if_fail (
- (param != NULL && error == NULL) ||
- (param == NULL && error != NULL));
-
- if (error != NULL) {
- g_simple_async_result_take_error (simple, error);
- return;
- }
-
- node = e_soap_parameter_get_first_child_by_name (param, "OofState");
- state = e_soap_parameter_get_string_value (node);
-
- node = e_soap_parameter_get_first_child_by_name (param, "ExternalAudience");
- ext_aud = e_soap_parameter_get_string_value (node);
-
- node = e_soap_parameter_get_first_child_by_name (param, "Duration");
-
- node_1 = e_soap_parameter_get_first_child_by_name (node, "StartTime");
- start_tm = e_soap_parameter_get_string_value (node_1);
-
- node_1 = e_soap_parameter_get_first_child_by_name (node, "EndTime");
- end_tm = e_soap_parameter_get_string_value (node_1);
-
- node = e_soap_parameter_get_first_child_by_name (param, "InternalReply");
- node_1 = e_soap_parameter_get_first_child_by_name (node, "Message");
- int_msg = e_soap_parameter_get_string_value (node_1);
- if (g_strrstr (int_msg, "</body>") || g_strrstr (int_msg, "BodyFragment"))
- int_msg = get_text_from_html (int_msg);
-
- node = e_soap_parameter_get_first_child_by_name (param, "ExternalReply");
- node_1 = e_soap_parameter_get_first_child_by_name (node, "Message");
- ext_msg = e_soap_parameter_get_string_value (node_1);
- if (g_strrstr (ext_msg, "</body>") || g_strrstr (ext_msg, "BodyFragment"))
- ext_msg = get_text_from_html (ext_msg);
-
- oof_settings = g_new0 (OOFSettings, 1);
-
- oof_settings->state = state;
- oof_settings->ext_aud = ext_aud;
-
- if (g_time_val_from_iso8601 (start_tm, &time_val))
- oof_settings->start_tm = time_val.tv_sec;
-
- if (g_time_val_from_iso8601 (end_tm, &time_val))
- oof_settings->end_tm = time_val.tv_sec;
-
- oof_settings->int_reply = int_msg;
- oof_settings->ext_reply = ext_msg;
-
- async_data = g_simple_async_result_get_op_res_gpointer (simple);
- async_data->items = g_slist_append (async_data->items, oof_settings);
-
- g_free (start_tm);
- g_free (end_tm);
-}
-
static void
ews_handle_resolution_set_param (ESoapParameter *subparam,
EwsAsyncData *async_data)
@@ -6164,109 +6036,6 @@ e_ews_connection_get_delegate_sync (EEwsConnection *cnc,
}
-/**
- * e_ews_connection__get_oof_settings:
- * @cnc: The EWS Connection
- * @pri: The priority associated with the request
- * @cancellable: a GCancellable to monitor cancelled operations
- * @callback: Responses are parsed and returned to this callback
- * @user_data: user data passed to callback
- **/
-void
-e_ews_connection_get_oof_settings (EEwsConnection *cnc,
- gint pri,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- ESoapMessage *msg;
- GSimpleAsyncResult *simple;
- EwsAsyncData *async_data;
-
- g_return_if_fail (cnc != NULL);
-
- msg = e_ews_message_new_with_header (
- cnc->priv->uri, "GetUserOofSettingsRequest",
- NULL, NULL, EWS_EXCHANGE_2007_SP1);
-
- e_soap_message_start_element (msg, "Mailbox", NULL, NULL);
- e_ews_message_write_string_parameter (
- msg, "Address", NULL, cnc->priv->email);
- e_soap_message_end_element (msg);
-
- /* Complete the footer and print the request */
- e_ews_message_write_footer (msg);
-
- async_data = g_new0 (EwsAsyncData, 1);
-
- simple = g_simple_async_result_new (
- G_OBJECT (cnc), callback, user_data,
- e_ews_connection_get_oof_settings);
-
- g_simple_async_result_set_op_res_gpointer (
- simple, async_data, (GDestroyNotify) async_data_free);
-
- e_ews_connection_queue_request (
- cnc, msg, get_oof_settings_response_cb,
- pri, cancellable, simple);
-
- g_object_unref (simple);
-}
-
-gboolean
-e_ews_connection_get_oof_settings_finish (EEwsConnection *cnc,
- GAsyncResult *result,
- OOFSettings **oof_settings,
- GError **error)
-{
- GSimpleAsyncResult *simple;
- EwsAsyncData *async_data;
-
- g_return_val_if_fail (
- g_simple_async_result_is_valid (
- result, G_OBJECT (cnc), e_ews_connection_get_oof_settings),
- FALSE);
-
- simple = G_SIMPLE_ASYNC_RESULT (result);
- async_data = g_simple_async_result_get_op_res_gpointer (simple);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
-
- *oof_settings = (OOFSettings *) async_data->items->data;
-
- return TRUE;
-}
-
-gboolean
-e_ews_connection_get_oof_settings_sync (EEwsConnection *cnc,
- gint pri,
- OOFSettings **oof_settings,
- GCancellable *cancellable,
- GError **error)
-{
- EAsyncClosure *closure;
- GAsyncResult *result;
- gboolean success;
-
- g_return_val_if_fail (cnc != NULL, FALSE);
-
- closure = e_async_closure_new ();
-
- e_ews_connection_get_oof_settings (
- cnc, pri, cancellable,
- e_async_closure_callback, closure);
-
- result = e_async_closure_wait (closure);
-
- success = e_ews_connection_get_oof_settings_finish (
- cnc, result, oof_settings, error);
-
- e_async_closure_free (closure);
-
- return success;
-}
-
static void
set_oof_settings_response_cb (ESoapResponse *response,
GSimpleAsyncResult *simple)
diff --git a/src/server/e-ews-connection.h b/src/server/e-ews-connection.h
index e391c37..464a57b 100644
--- a/src/server/e-ews-connection.h
+++ b/src/server/e-ews-connection.h
@@ -817,24 +817,6 @@ gboolean e_ews_connection_get_delegate_sync
GCancellable *cancellable,
GError **error);
-void e_ews_connection_get_oof_settings
- (EEwsConnection *cnc,
- gint pri,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean e_ews_connection_get_oof_settings_finish
- (EEwsConnection *cnc,
- GAsyncResult *result,
- OOFSettings **oof_settings,
- GError **error);
-gboolean e_ews_connection_get_oof_settings_sync
- (EEwsConnection *cnc,
- gint pri,
- OOFSettings **oof_settings,
- GCancellable *cancellable,
- GError **error);
-
void e_ews_connection_set_oof_settings
(EEwsConnection *cnc,
gint pri,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]