diff options
author | Vitaly Minko <vitaly.minko@gmail.com> | 2010-11-12 22:47:51 +0800 |
---|---|---|
committer | Vitaly Minko <vitaly.minko@gmail.com> | 2010-11-12 22:47:51 +0800 |
commit | 875bf697d54f1c4ca98478ded849bc733828f758 (patch) | |
tree | e623330e91d22c72a3293baabde6d2cfe4b5450a /src/empathy-new-chatroom-dialog.c | |
parent | 18d649cbfd8eda7678957a3d2a76b9bb8681a981 (diff) | |
download | gsoc2013-empathy-875bf697d54f1c4ca98478ded849bc733828f758.tar gsoc2013-empathy-875bf697d54f1c4ca98478ded849bc733828f758.tar.gz gsoc2013-empathy-875bf697d54f1c4ca98478ded849bc733828f758.tar.bz2 gsoc2013-empathy-875bf697d54f1c4ca98478ded849bc733828f758.tar.lz gsoc2013-empathy-875bf697d54f1c4ca98478ded849bc733828f758.tar.xz gsoc2013-empathy-875bf697d54f1c4ca98478ded849bc733828f758.tar.zst gsoc2013-empathy-875bf697d54f1c4ca98478ded849bc733828f758.zip |
Make AccountChooser-related code simpler and clearer (re #633481).
Diffstat (limited to 'src/empathy-new-chatroom-dialog.c')
-rw-r--r-- | src/empathy-new-chatroom-dialog.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c index 6cf45ad83..58690d139 100644 --- a/src/empathy-new-chatroom-dialog.c +++ b/src/empathy-new-chatroom-dialog.c @@ -146,42 +146,16 @@ conn_prepared_cb (GObject *conn, FilterCallbackData *data = user_data; GError *myerr = NULL; TpCapabilities *caps; - GPtrArray *classes; - guint i; - if (!tp_proxy_prepare_finish (conn, result, &myerr)) - goto out; - - caps = tp_connection_get_capabilities (TP_CONNECTION (conn)); - classes = tp_capabilities_get_channel_classes (caps); - - for (i = 0; i < classes->len; i++) { - GHashTable *fixed; - GStrv allowed; - const gchar *chan_type; - - tp_value_array_unpack (g_ptr_array_index (classes, i), 2, - &fixed, &allowed); - - chan_type = tp_asv_get_string (fixed, - TP_PROP_CHANNEL_CHANNEL_TYPE); - - if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT)) - continue; - - if (tp_asv_get_uint32 (fixed, - TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, - NULL) != - TP_HANDLE_TYPE_ROOM) - continue; - - data->callback (TRUE, data->user_data); + if (!tp_proxy_prepare_finish (conn, result, &myerr)) { + data->callback (FALSE, data->user_data); g_slice_free (FilterCallbackData, data); - return; } -out: - data->callback (FALSE, data->user_data); + caps = tp_connection_get_capabilities (TP_CONNECTION (conn)); + data->callback (tp_capabilities_supports_text_chatrooms (caps), + data->user_data); + g_slice_free (FilterCallbackData, data); } |