telepathy-glib: Fix retrieving the remove contact from a MediaDescription hash
Simon McVittie
smcv at kemper.freedesktop.org
Mon Jan 7 05:06:37 PST 2013
Module: telepathy-glib
Branch: master
Commit: 4c886ee65c1e74ceb866f9d8b94d05cd1b0ab254
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=4c886ee65c1e74ceb866f9d8b94d05cd1b0ab254
Author: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
Date: Mon Sep 3 11:14:34 2012 +0200
Fix retrieving the remove contact from a MediaDescription hash
Correctly get the remote contact handle out of the MediaDescription
hash, it's an a{sv} not string => uint32.
Reviewed-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54425
Conflicts:
telepathy-glib/base-media-call-content.c
---
telepathy-glib/base-media-call-content.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/telepathy-glib/base-media-call-content.c b/telepathy-glib/base-media-call-content.c
index cf55523..eb15db7 100644
--- a/telepathy-glib/base-media-call-content.c
+++ b/telepathy-glib/base-media-call-content.c
@@ -681,11 +681,13 @@ tp_base_media_call_content_update_local_media_description (
TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (iface);
GHashTable *current_properties;
GPtrArray *codecs;
- gpointer contact;
+ TpHandle contact;
+ gboolean valid;
+
+ contact = tp_asv_get_uint32 (properties,
+ TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT, &valid);
- if (!g_hash_table_lookup_extended (properties,
- TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT,
- NULL, &contact))
+ if (!valid)
{
GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"The media description is missing the RemoteContact key." };
@@ -695,7 +697,7 @@ tp_base_media_call_content_update_local_media_description (
current_properties = g_hash_table_lookup (
self->priv->local_media_descriptions,
- contact);
+ GUINT_TO_POINTER (contact));
if (current_properties == NULL)
{
@@ -718,7 +720,7 @@ tp_base_media_call_content_update_local_media_description (
}
if (self->priv->current_offer != NULL &&
- tp_call_content_media_description_get_remote_contact (self->priv->current_offer) == GPOINTER_TO_UINT (contact))
+ tp_call_content_media_description_get_remote_contact (self->priv->current_offer) == contact)
{
GError error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
"Can not update the media description while there is"
@@ -727,7 +729,7 @@ tp_base_media_call_content_update_local_media_description (
return;
}
- set_local_properties (self, GPOINTER_TO_UINT (contact), properties);
+ set_local_properties (self, contact, properties);
tp_svc_call_content_interface_media_return_from_update_local_media_description
(context);
More information about the telepathy-commits
mailing list