summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-06-25 00:24:10 +0200
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-06-25 00:24:16 +0200
commitd1e2397dc684b609ac5f9b78fd4d5b1e2b24c452 (patch)
tree69d2ba78fcec9781497790fcc07f710e8dbbcfb3
parent58a742936ea0a71da0df61043236c65ba485be8d (diff)
Cope with the default value of handle-type being changed in new tp-glib
In recent versions of tp-glib the handle-type property defaults to TP_UNKNOWN_HANDLE_TYPE instead of 0. Update the various assertions which verify a channel doesn't get constructed with an unexpected handle type to accept both 0 and TP_UNKNOWN_HANDLE_TYPE so we're compatible with both versions.
-rw-r--r--src/file-transfer-channel.c5
-rw-r--r--src/im-channel.c7
-rw-r--r--src/muc-channel.c5
-rw-r--r--src/roomlist-channel.c6
4 files changed, 17 insertions, 6 deletions
diff --git a/src/file-transfer-channel.c b/src/file-transfer-channel.c
index 794631f6..4d93a465 100644
--- a/src/file-transfer-channel.c
+++ b/src/file-transfer-channel.c
@@ -354,8 +354,11 @@ salut_file_transfer_channel_set_property (GObject *object,
self->priv->connection = g_value_get_object (value);
break;
case PROP_HANDLE_TYPE:
+ /* 0 is the old tp-glib value of unset, TP_UNKNOWN_HANDLE_TYPE is the
+ * new version */
g_assert (g_value_get_uint (value) == 0
- || g_value_get_uint (value) == TP_HANDLE_TYPE_CONTACT);
+ || g_value_get_uint (value) == TP_HANDLE_TYPE_CONTACT
+ || g_value_get_uint (value) == TP_UNKNOWN_HANDLE_TYPE);
break;
case PROP_CHANNEL_TYPE:
/* these properties are writable in the interface, but not actually
diff --git a/src/im-channel.c b/src/im-channel.c
index 4843e38f..722f1bae 100644
--- a/src/im-channel.c
+++ b/src/im-channel.c
@@ -250,8 +250,11 @@ salut_im_channel_set_property (GObject *object,
priv->connection = g_value_get_object (value);
break;
case PROP_HANDLE_TYPE:
- g_assert (g_value_get_uint (value) == 0 ||
- g_value_get_uint (value) == TP_HANDLE_TYPE_CONTACT);
+ /* 0 is the old tp-glib value of unset, TP_UNKNOWN_HANDLE_TYPE is the
+ * new version */
+ g_assert (g_value_get_uint (value) == 0
+ || g_value_get_uint (value) == TP_HANDLE_TYPE_CONTACT
+ || g_value_get_uint (value) == TP_UNKNOWN_HANDLE_TYPE);
break;
case PROP_CHANNEL_TYPE:
tmp = g_value_get_string (value);
diff --git a/src/muc-channel.c b/src/muc-channel.c
index b8b0fbb3..9be5bf7f 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -268,8 +268,11 @@ salut_muc_channel_set_property (GObject *object,
priv->muc_connection = g_value_get_object (value);
break;
case PROP_HANDLE_TYPE:
+ /* 0 is the old tp-glib value of unset, TP_UNKNOWN_HANDLE_TYPE is the
+ * new version */
g_assert (g_value_get_uint (value) == 0
- || g_value_get_uint (value) == TP_HANDLE_TYPE_ROOM);
+ || g_value_get_uint (value) == TP_HANDLE_TYPE_ROOM
+ || g_value_get_uint (value) == TP_UNKNOWN_HANDLE_TYPE);
break;
case PROP_CHANNEL_TYPE:
tmp = g_value_get_string (value);
diff --git a/src/roomlist-channel.c b/src/roomlist-channel.c
index aad3c480..362c37c9 100644
--- a/src/roomlist-channel.c
+++ b/src/roomlist-channel.c
@@ -227,8 +227,10 @@ salut_roomlist_channel_set_property (GObject *object,
break;
case PROP_HANDLE_TYPE:
/* this property is writable in the interface, but not actually
- * meaningfully changable on this channel, so we do nothing */
- g_assert (g_value_get_uint (value) == TP_HANDLE_TYPE_NONE);
+ * meaningfully changable on this channel, so we do nothing.
+ * */
+ g_assert (g_value_get_uint (value) == TP_HANDLE_TYPE_NONE
+ || g_value_get_uint (value) == TP_UNKNOWN_HANDLE_TYPE);
break;
case PROP_CONNECTION:
priv->connection = g_value_get_object (value);