diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-12-21 13:48:08 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-22 16:29:49 +0100 |
commit | 8ca567b5fe1f1ae576d2abd6b557ecbc4c90912a (patch) | |
tree | 9ebc84554eb8be1db83ad92fe8ab5d61ba68fe20 /telepathy-glib/util.c | |
parent | 4e44959998dbab6daa9bbaf4b9f3ab765a3aaa70 (diff) | |
download | telepathy-glib-8ca567b5fe1f1ae576d2abd6b557ecbc4c90912a.tar.gz |
factor out _tp_create_channel_request_list
Diffstat (limited to 'telepathy-glib/util.c')
-rw-r--r-- | telepathy-glib/util.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c index 63ac10f36..7a2ac58f3 100644 --- a/telepathy-glib/util.c +++ b/telepathy-glib/util.c @@ -1540,3 +1540,33 @@ _tp_create_temp_unix_socket (GSocketService *service, return NULL; } #endif /* HAVE_GIO_UNIX */ + +GList * +_tp_create_channel_request_list (TpDBusDaemon *dbus, + GHashTable *request_props) +{ + GHashTableIter iter; + GList *result = NULL; + gpointer key, value; + + g_hash_table_iter_init (&iter, request_props); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + TpChannelRequest *req; + const gchar *path = key; + GHashTable *props = value; + GError *error = NULL; + + req = tp_channel_request_new (dbus, path, props, &error); + if (req == NULL) + { + DEBUG ("Failed to create TpChannelRequest: %s", error->message); + g_error_free (error); + continue; + } + + result = g_list_prepend (result, req); + } + + return result; +} |