From 573700ecb680cc3753a362774214f93373df6936 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 27 Jan 2012 15:39:46 +0100 Subject: [PATCH] mc-tool: display Addressing.URISchemes https://bugs.freedesktop.org/show_bug.cgi?id=45308 --- util/mc-tool.c | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/util/mc-tool.c b/util/mc-tool.c index f55d4bb..240c7ff 100644 --- a/util/mc-tool.c +++ b/util/mc-tool.c @@ -321,6 +321,23 @@ show_presence (gchar const *what, struct presence *presence) presence->type, presence->message); } +static int +show_uri_schemes (const gchar * const *schemes) +{ + int result; + gchar *tmp; + + if (schemes == NULL || schemes[0] == NULL) + tmp = g_strdup (""); + else + tmp = g_strjoinv (", ", (gchar **) schemes); + + result = printf ("%12s: %s\n", "URIScheme", tmp); + + g_free (tmp); + return result; +} + static void free_presence (struct presence *presence) { @@ -625,6 +642,7 @@ command_show (TpAccount *account) GHashTableIter i[1]; gpointer keyp, valuep; struct presence automatic, current, requested; + const gchar * const *schemes; name = skip_prefix (command.common.account); @@ -664,6 +682,11 @@ command_show (TpAccount *account) tp_account_get_changing_presence (account) ? "yes" : "no"); puts (""); + puts ("Addressing:"); + schemes = tp_account_get_uri_schemes (account); + show_uri_schemes (schemes); + + puts (""); parameters = tp_account_get_parameters (account); for (g_hash_table_iter_init (i, (GHashTable *) parameters); @@ -1250,6 +1273,8 @@ main (int argc, char **argv) tp_proxy_prepare_async (am, NULL, manager_ready, NULL); } else { + const GQuark features[] = { TP_ACCOUNT_FEATURE_CORE, TP_ACCOUNT_FEATURE_ADDRESSING, 0 }; + command.common.account = ensure_prefix (command.common.account); a = tp_account_new (dbus, command.common.account, &error); @@ -1261,7 +1286,7 @@ main (int argc, char **argv) goto out; } - tp_proxy_prepare_async (a, NULL, account_ready, NULL); + tp_proxy_prepare_async (a, features, account_ready, NULL); } main_loop = g_main_loop_new (NULL, FALSE); -- 1.7.7.6