From ed05b3b360b9017845d0a1e146d86055890e366a Mon Sep 17 00:00:00 2001 From: Vivek Jain Date: Wed, 2 Feb 2005 07:18:22 +0000 Subject: [PATCH] added a function (e_gw_connection_get_version) added version in 2005-01-31 Vivek Jain * e-gw-connection.[ch] : added a function (e_gw_connection_get_version) * e-gw-connection.c : added version in _EGwConnectionPrivate (e_gw_connection_new): parse response to get server version --- servers/groupwise/ChangeLog | 6 ++++++ servers/groupwise/e-gw-connection.c | 18 ++++++++++++++++++ servers/groupwise/e-gw-connection.h | 1 + 3 files changed, 25 insertions(+) diff --git a/servers/groupwise/ChangeLog b/servers/groupwise/ChangeLog index a494f1a..4757ac8 100644 --- a/servers/groupwise/ChangeLog +++ b/servers/groupwise/ChangeLog @@ -1,3 +1,9 @@ +2005-01-31 Vivek Jain + * e-gw-connection.[ch] : added a function + (e_gw_connection_get_version) + * e-gw-connection.c : added version in _EGwConnectionPrivate + (e_gw_connection_new): parse response to get server version + 2005-01-31 Chenthill Palanisamy * e-gw-item.c: (e_gw_item_set_calendar_item_elements): diff --git a/servers/groupwise/e-gw-connection.c b/servers/groupwise/e-gw-connection.c index 4dcad34..d640f4c 100644 --- a/servers/groupwise/e-gw-connection.c +++ b/servers/groupwise/e-gw-connection.c @@ -47,6 +47,7 @@ struct _EGwConnectionPrivate { char *user_name; char *user_email; char *user_uuid; + char *version; EGwSendOptions *opts; GMutex *reauth_mutex; }; @@ -480,6 +481,15 @@ e_gw_connection_new (const char *uri, const char *username, const char *password } } + param = soup_soap_response_get_first_parameter_by_name (response, "gwVersion"); + if (param) { + char *param_value; + param_value = soup_soap_parameter_get_string_value (param); + cnc->priv->version = param_value; + } else + cnc->priv->version = NULL; + + /* add the connection to the loaded_connections hash table */ hash_key = g_strdup_printf ("%s:%s@%s", cnc->priv->username ? cnc->priv->username : "", @@ -1285,6 +1295,14 @@ e_gw_connection_complete_request (EGwConnection *cnc, const char *id) } const char * +e_gw_connection_get_version (EGwConnection *cnc) +{ + g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL); + + return (const char *) cnc->priv->version; +} + +const char * e_gw_connection_get_uri (EGwConnection *cnc) { g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL); diff --git a/servers/groupwise/e-gw-connection.h b/servers/groupwise/e-gw-connection.h index 1c55aa6..b71871d 100644 --- a/servers/groupwise/e-gw-connection.h +++ b/servers/groupwise/e-gw-connection.h @@ -90,6 +90,7 @@ const char *e_gw_connection_get_session_id (EGwConnection *cnc); const char *e_gw_connection_get_user_name (EGwConnection *cnc); const char *e_gw_connection_get_user_email (EGwConnection *cnc); const char *e_gw_connection_get_user_uuid (EGwConnection *cnc); +const char *e_gw_connection_get_version (EGwConnection *cnc); time_t e_gw_connection_get_date_from_string (const char *dtstring); -- 2.7.4