diff options
author | Pekka Pessi <Pekka.Pessi@nokia.com> | 2011-01-31 21:16:28 +0200 |
---|---|---|
committer | Pekka Pessi <Pekka.Pessi@nokia.com> | 2011-02-02 17:22:06 +0200 |
commit | 3d9b980d25b2c3ed1341ec7fcd799e4201a984d2 (patch) | |
tree | eb66b9314dad64c8abc4d5328454242a8ffe98fc | |
parent | a3359d8f6f1c7394ea693c18da79d3208d229afd (diff) |
sip-connection-helpers: remove tpsip/handles functionality
- tpsip_conn_get_contact_url replaced by tpsip_handle_inspect_uri
- tpsip_handle_parse_from replaced by tpsip_handle_by_requestor
-rw-r--r-- | src/sip-connection-helpers.c | 75 | ||||
-rw-r--r-- | src/sip-connection-helpers.h | 20 |
2 files changed, 2 insertions, 93 deletions
diff --git a/src/sip-connection-helpers.c b/src/sip-connection-helpers.c index a60afeb..090472c 100644 --- a/src/sip-connection-helpers.c +++ b/src/sip-connection-helpers.c @@ -31,6 +31,7 @@ #include <telepathy-glib/svc-connection.h> #include <tpsip/util.h> +#include <tpsip/handles.h> #include "sip-connection-helpers.h" @@ -63,7 +64,7 @@ priv_sip_to_url_make (TpsipConnection *conn, { const url_t *url; - url = tpsip_conn_get_contact_url (conn, contact); + url = tpsip_handle_inspect_uri (TP_BASE_CONNECTION (conn), contact); return sip_to_create (home, (const url_string_t *) url); } @@ -694,78 +695,6 @@ tpsip_handle_normalize (TpHandleRepoIface *repo, error); } -static GQuark -tpsip_handle_url_quark () -{ - static GQuark quark = 0; - - if (G_UNLIKELY (quark == 0)) - quark = g_quark_from_static_string ("tpsip-handle-url"); - - return quark; -} - -const url_t* -tpsip_conn_get_contact_url (TpsipConnection *self, - TpHandle handle) -{ - TpBaseConnection *base = (TpBaseConnection *) self; - TpsipConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); - TpHandleRepoIface *contact_handles; - GQuark url_quark; - url_t *url; - GError *error; - - contact_handles = tp_base_connection_get_handles (base, - TP_HANDLE_TYPE_CONTACT); - - if (!tp_handle_is_valid (contact_handles, handle, &error)) - { - DEBUG("invalid handle %u: %s", handle, error->message); - g_error_free (error); - return NULL; - } - - url_quark = tpsip_handle_url_quark (); - - url = tp_handle_get_qdata (contact_handles, handle, url_quark); - - if (url == NULL) - { - url = url_make (priv->sofia_home, - tp_handle_inspect (contact_handles, handle)); - - tp_handle_set_qdata (contact_handles, handle, url_quark, url, NULL); - } - - return url; -} - -TpHandle -tpsip_handle_parse_from (TpHandleRepoIface *contact_repo, - const sip_t *sip) -{ - TpHandle handle = 0; - gchar *url_str; - - g_return_val_if_fail (sip != NULL, 0); - - if (sip->sip_from) - { - su_home_t tmphome[1] = { SU_HOME_INIT(tmphome) }; - - url_str = url_as_string (tmphome, sip->sip_from->a_url); - - handle = tp_handle_ensure (contact_repo, url_str, NULL, NULL); - - /* TODO: set qdata for the display name */ - - su_home_deinit (tmphome); - } - - return handle; -} - #ifdef HAVE_LIBIPHB static int diff --git a/src/sip-connection-helpers.h b/src/sip-connection-helpers.h index 4644908..ca018a3 100644 --- a/src/sip-connection-helpers.h +++ b/src/sip-connection-helpers.h @@ -58,26 +58,6 @@ void tpsip_conn_save_event (TpsipConnection *conn, nua_saved_event_t ret_saved [1]); /*********************************************************************** - * SIP URI helpers - ***********************************************************************/ - -gchar * tpsip_handle_normalize (TpHandleRepoIface *repo, - const gchar *sipuri, - gpointer context, - GError **error); - -gchar *tpsip_normalize_contact (const gchar *sipuri, - const url_t *base_url, - const gchar *transport, - GError **error); - -const url_t* tpsip_conn_get_contact_url (TpsipConnection *conn, - TpHandle handle); - -TpHandle tpsip_handle_parse_from (TpHandleRepoIface *contact_repo, - const sip_t *sip); - -/*********************************************************************** * Heartbeat management for keepalives ***********************************************************************/ |