diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-02-18 15:43:48 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2014-02-27 15:06:21 +0100 |
commit | 391ebdcee54706129a9b9c1f67eb9c2fabdb0f51 (patch) | |
tree | 8d707cfee130be9ea1a83589c6ddb496fbbb2899 /examples | |
parent | 9c28eb21fd81aa1527e4099d0adb173773ec29a2 (diff) |
examples: use tp_base_client_*_vardict API
Looks like we forgot to re-enable some code while porting to Call.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/client/approver.c | 45 | ||||
-rw-r--r-- | examples/client/dbus-tubes/accepter.c | 19 | ||||
-rw-r--r-- | examples/client/media-observer.c | 12 | ||||
-rw-r--r-- | examples/client/stream-tubes/accepter.c | 19 | ||||
-rw-r--r-- | examples/client/text-handler.c | 17 |
5 files changed, 43 insertions, 69 deletions
diff --git a/examples/client/approver.c b/examples/client/approver.c index adf91bb44..7ba9fd720 100644 --- a/examples/client/approver.c +++ b/examples/client/approver.c @@ -142,37 +142,28 @@ main (int argc, FALSE, add_dispatch_operation_cb, NULL, NULL); /* contact text chat */ - tp_base_client_take_approver_filter (approver, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_TEXT, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, G_TYPE_UINT, - TP_ENTITY_TYPE_CONTACT, - NULL)); - - /* call - tp_base_client_take_approver_filter (approver, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_CALL, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, G_TYPE_UINT, - TP_ENTITY_TYPE_CONTACT, - NULL)); - */ + tp_base_client_add_approver_filter_vardict (approver, + g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", + TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, + TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT)); + + /* calls */ + tp_base_client_add_approver_filter_vardict (approver, + g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", + TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_CALL1, + TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT)); /* room text chat */ - tp_base_client_take_approver_filter (approver, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_TEXT, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, G_TYPE_UINT, - TP_ENTITY_TYPE_ROOM, - NULL)); + tp_base_client_add_approver_filter_vardict (approver, + g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", + TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, + TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_ROOM)); /* file transfer */ - tp_base_client_take_approver_filter (approver, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER1, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, G_TYPE_UINT, - TP_ENTITY_TYPE_CONTACT, - NULL)); + tp_base_client_add_approver_filter_vardict (approver, + g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", + TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER1, + TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT)); if (!tp_base_client_register (approver, &error)) { diff --git a/examples/client/dbus-tubes/accepter.c b/examples/client/dbus-tubes/accepter.c index bbff74981..58aa757b4 100644 --- a/examples/client/dbus-tubes/accepter.c +++ b/examples/client/dbus-tubes/accepter.c @@ -169,20 +169,11 @@ main (int argc, handler = tp_simple_handler_new_with_am (manager, FALSE, FALSE, "ExampleServiceHandler", FALSE, handle_channel, NULL, NULL); - tp_base_client_take_handler_filter (handler, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, - G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_DBUS_TUBE1, - - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, - G_TYPE_UINT, - TP_ENTITY_TYPE_CONTACT, - - TP_PROP_CHANNEL_TYPE_DBUS_TUBE1_SERVICE_NAME, - G_TYPE_STRING, - EXAMPLE_SERVICE_NAME, - - NULL)); + tp_base_client_add_handler_filter_vardict (handler, + g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, %s: <%s> }", + TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE1, + TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT, + TP_PROP_CHANNEL_TYPE_DBUS_TUBE1_SERVICE_NAME, EXAMPLE_SERVICE_NAME)); tp_base_client_register (handler, &error); g_assert_no_error (error); diff --git a/examples/client/media-observer.c b/examples/client/media-observer.c index 9e1ae38f2..90f44f36d 100644 --- a/examples/client/media-observer.c +++ b/examples/client/media-observer.c @@ -13,6 +13,7 @@ #include <glib.h> #include <telepathy-glib/telepathy-glib.h> +#include <telepathy-glib/telepathy-glib-dbus.h> static void chan_invalidated_cb (TpProxy *proxy, @@ -71,14 +72,11 @@ main (int argc, observer = tp_simple_observer_new_with_am (manager, FALSE, "ExampleMediaObserver", FALSE, observe_channel_cb, NULL, NULL); - /* - tp_base_client_take_observer_filter (observer, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_CALL, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, G_TYPE_UINT, - TP_ENTITY_TYPE_CONTACT, + tp_base_client_add_observer_filter_vardict (observer, + g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", + TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_CALL1, + TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT, NULL)); - */ if (!tp_base_client_register (observer, &error)) { diff --git a/examples/client/stream-tubes/accepter.c b/examples/client/stream-tubes/accepter.c index ca0649dd3..11bf02cbe 100644 --- a/examples/client/stream-tubes/accepter.c +++ b/examples/client/stream-tubes/accepter.c @@ -111,20 +111,11 @@ main (int argc, handler = tp_simple_handler_new_with_am (manager, FALSE, FALSE, "ExampleServiceHandler", FALSE, _handle_channel, NULL, NULL); - tp_base_client_take_handler_filter (handler, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, - G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_STREAM_TUBE1, - - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, - G_TYPE_UINT, - TP_ENTITY_TYPE_CONTACT, - - TP_PROP_CHANNEL_TYPE_STREAM_TUBE1_SERVICE, - G_TYPE_STRING, - "ExampleService", - - NULL)); + tp_base_client_add_handler_filter_vardict (handler, + g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, %s: <%s> }", + TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE1, + TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, (guint32) TP_ENTITY_TYPE_CONTACT, + TP_PROP_CHANNEL_TYPE_STREAM_TUBE1_SERVICE, "ExampleService")); tp_base_client_register (handler, &error); g_assert_no_error (error); diff --git a/examples/client/text-handler.c b/examples/client/text-handler.c index db722acd5..379c5816b 100644 --- a/examples/client/text-handler.c +++ b/examples/client/text-handler.c @@ -106,19 +106,22 @@ main (int argc, GMainLoop *mainloop; GError *error = NULL; TpBaseClient *handler; + GVariantDict dict; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); handler = tp_simple_handler_new (NULL, FALSE, FALSE, "ExampleHandler", FALSE, handle_channel_cb, NULL, NULL); - tp_base_client_take_handler_filter (handler, tp_asv_new ( - TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TP_IFACE_CHANNEL_TYPE_TEXT, - TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, G_TYPE_UINT, - TP_ENTITY_TYPE_CONTACT, - TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, - NULL)); + g_variant_dict_init (&dict, NULL); + g_variant_dict_insert (&dict, TP_PROP_CHANNEL_CHANNEL_TYPE, "s", + TP_IFACE_CHANNEL_TYPE_TEXT); + g_variant_dict_insert (&dict, TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, "u", + (guint32) TP_ENTITY_TYPE_CONTACT); + g_variant_dict_insert (&dict, TP_PROP_CHANNEL_REQUESTED, "b", FALSE); + + tp_base_client_add_handler_filter_vardict (handler, + g_variant_dict_end (&dict)); if (!tp_base_client_register (handler, &error)) { |