summaryrefslogtreecommitdiff
path: root/examples/cm/channelspecific/room.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cm/channelspecific/room.c')
-rw-r--r--examples/cm/channelspecific/room.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/examples/cm/channelspecific/room.c b/examples/cm/channelspecific/room.c
index f8a83ad0c..d6cdfc893 100644
--- a/examples/cm/channelspecific/room.c
+++ b/examples/cm/channelspecific/room.c
@@ -98,7 +98,6 @@ complete_join (ExampleCSHRoomChannel *self)
TpHandle alice_global, bob_global, chris_global;
TpGroupMixin *mixin = TP_GROUP_MIXIN (self);
TpIntset *added;
- GHashTable *details;
/* For this example, we assume that all chatrooms initially contain
* Alice, Bob and Chris (and that their global IDs are also known),
@@ -145,16 +144,11 @@ complete_join (ExampleCSHRoomChannel *self)
tp_base_connection_get_self_handle (conn));
tp_group_mixin_change_self_handle ((GObject *) self, new_self);
- details = tp_asv_new (
- "message", G_TYPE_STRING, "",
- "change-reason", G_TYPE_UINT, TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED,
- "actor", G_TYPE_UINT, 0,
- NULL);
-
tp_group_mixin_change_members ((GObject *) self, NULL, removed, NULL,
- rp, details);
+ rp,
+ g_variant_new_parsed ("{'change-reason': <%u>}",
+ (guint32) TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED));
- tp_clear_pointer (&details, g_hash_table_unref);
tp_intset_destroy (removed);
tp_intset_destroy (rp);
}
@@ -177,16 +171,8 @@ complete_join (ExampleCSHRoomChannel *self)
tp_intset_add (added, anon_local);
tp_intset_add (added, mixin->self_handle);
- details = tp_asv_new (
- "message", G_TYPE_STRING, "",
- "change-reason", G_TYPE_UINT, TP_CHANNEL_GROUP_CHANGE_REASON_NONE,
- "actor", G_TYPE_UINT, 0,
- NULL);
-
tp_group_mixin_change_members ((GObject *) self, added, NULL, NULL,
- NULL, details);
-
- tp_clear_pointer (&details, g_hash_table_unref);
+ NULL, NULL);
/* now that the dust has settled, we can also invite people */
tp_group_mixin_change_flags ((GObject *) self,
@@ -202,7 +188,6 @@ join_room (ExampleCSHRoomChannel *self)
TpGroupMixin *mixin = TP_GROUP_MIXIN (self);
GObject *object = (GObject *) self;
TpIntset *add_remote_pending;
- GHashTable *details;
g_assert (!tp_handle_set_is_member (mixin->members, mixin->self_handle));
g_assert (!tp_handle_set_is_member (mixin->remote_pending,
@@ -213,18 +198,13 @@ join_room (ExampleCSHRoomChannel *self)
add_remote_pending = tp_intset_new ();
tp_intset_add (add_remote_pending, mixin->self_handle);
- details = tp_asv_new (
- "message", G_TYPE_STRING, "",
- "change-reason", G_TYPE_UINT, TP_CHANNEL_GROUP_CHANGE_REASON_NONE,
- "actor", G_TYPE_UINT, tp_base_connection_get_self_handle (conn),
- NULL);
-
tp_group_mixin_add_handle_owner (object, mixin->self_handle,
tp_base_connection_get_self_handle (conn));
tp_group_mixin_change_members (object, NULL, NULL, NULL,
- add_remote_pending, details);
+ add_remote_pending,
+ g_variant_new_parsed ("{'actor': <%u>}",
+ (guint32) tp_base_connection_get_self_handle (conn)));
- g_hash_table_unref (details);
tp_intset_destroy (add_remote_pending);
/* Actually join the room. In a real implementation this would be a network