diff options
author | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-05-13 14:37:07 +0200 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-05-14 13:18:10 +0200 |
commit | b4516c17b2daf0c098b257f7881afcb73b69270c (patch) | |
tree | e9646f6ac016b275ca03dcf3654a747096849a6f | |
parent | 27ef72303ec083ba75d8d7e667a0049c2363411a (diff) |
Remove deprecated ChatState API from TpChannel
Move implementation to TpTextChannel
-rw-r--r-- | docs/reference/telepathy-glib-sections.txt | 8 | ||||
-rw-r--r-- | next-NEWS | 2 | ||||
-rw-r--r-- | telepathy-glib/channel-internal.h | 4 | ||||
-rw-r--r-- | telepathy-glib/channel.c | 151 | ||||
-rw-r--r-- | telepathy-glib/channel.h | 9 | ||||
-rw-r--r-- | telepathy-glib/text-channel.c | 124 | ||||
-rw-r--r-- | tests/dbus/channel-introspect.c | 24 | ||||
-rw-r--r-- | tests/dbus/text-channel.c | 6 |
8 files changed, 100 insertions, 228 deletions
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index 1ae3d8a80..7685ae102 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -3011,15 +3011,11 @@ tp_channel_close_finish tp_channel_destroy_async tp_channel_destroy_finish <SUBSECTION Private> -tp_channel_get_feature_quark_chat_states tp_channel_get_feature_quark_core tp_channel_get_feature_quark_group tp_channel_get_feature_quark_contacts tp_channel_get_feature_quark_password <SUBSECTION> -TP_CHANNEL_FEATURE_CHAT_STATES -tp_channel_get_chat_state -<SUBSECTION> TP_CHANNEL_FEATURE_GROUP tp_channel_group_get_flags tp_channel_group_get_self_contact @@ -5370,8 +5366,6 @@ tp_text_channel_ack_message_async tp_text_channel_ack_message_finish tp_text_channel_ack_all_pending_messages_async tp_text_channel_ack_all_pending_messages_finish -tp_text_channel_set_chat_state_async -tp_text_channel_set_chat_state_finish tp_text_channel_supports_message_type <SUBSECTION> TP_TEXT_CHANNEL_FEATURE_SMS @@ -5382,6 +5376,8 @@ tp_text_channel_get_sms_length_finish <SUBSECTION> TP_TEXT_CHANNEL_FEATURE_CHAT_STATES tp_text_channel_get_chat_state +tp_text_channel_set_chat_state_async +tp_text_channel_set_chat_state_finish <SUBSECTION Standard> TP_IS_TEXT_CHANNEL TP_IS_TEXT_CHANNEL_CLASS @@ -46,3 +46,5 @@ API/Behaviour changes * tp_channel_group_get_local_pending_contact_info -> tp_channel_group_get_local_pending_info; * tp_channel_group_dup_remote_pending_contacts -> tp_channel_group_dup_remote_pending; * "group-contacts-changed" -> "group-members-changed". + + - "contact-chat-state-changed" signal has been renamed to "chat-state-changed". diff --git a/telepathy-glib/channel-internal.h b/telepathy-glib/channel-internal.h index 65a9be923..20cfe91dd 100644 --- a/telepathy-glib/channel-internal.h +++ b/telepathy-glib/channel-internal.h @@ -76,10 +76,6 @@ struct _TpChannelPrivate { /* Item currently being prepared, not part of contacts_queue anymore */ GSimpleAsyncResult *current_contacts_queue_result; - /* NULL, or TpHandle => TpChannelChatState; - * if non-NULL, we're watching for ChatStateChanged */ - GHashTable *chat_states; - /* These are really booleans, but gboolean is signed. Thanks, GLib */ /* Enough method calls have succeeded that we believe that the channel diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c index 3388c01e8..4ff2e675f 100644 --- a/telepathy-glib/channel.c +++ b/telepathy-glib/channel.c @@ -104,7 +104,6 @@ enum enum { SIGNAL_GROUP_FLAGS_CHANGED, SIGNAL_GROUP_MEMBERS_CHANGED, - SIGNAL_CHAT_STATE_CHANGED, N_SIGNALS }; @@ -174,28 +173,6 @@ tp_channel_get_feature_quark_group (void) return g_quark_from_static_string ("tp-channel-feature-group"); } -/** - * TP_CHANNEL_FEATURE_CHAT_STATES: - * - * Expands to a call to a function that returns a quark representing the - * chat states feature on a #TpChannel. - * - * When this feature is prepared, tp_channel_get_chat_state() and the - * #TpChannel::chat-state-changed signal become useful. - * - * One can ask for a feature to be prepared using the - * tp_proxy_prepare_async() function, and waiting for it to callback. - * - * Since: 0.11.3 - * Deprecated: Use TP_TEXT_CHANNEL_FEATURE_CHAT_STATES instead. - */ - -GQuark -tp_channel_get_feature_quark_chat_states (void) -{ - return g_quark_from_static_string ("tp-channel-feature-chat-states"); -} - /* Convenient property accessors for C (these duplicate the properties) */ @@ -450,38 +427,6 @@ tp_channel_get_property (GObject *object, } } -/** - * tp_channel_get_chat_state: - * @self: a channel - * @contact: a contact handle - * - * Return the chat state for the given contact. If tp_proxy_is_prepared() - * would return %FALSE for the feature %TP_CHANNEL_FEATURE_CHAT_STATES, - * the result will always be %TP_CHANNEL_CHAT_STATE_INACTIVE. - * - * Returns: the chat state for @contact, or %TP_CHANNEL_CHAT_STATE_INACTIVE - * if their chat state is not known - * Since: 0.11.3 - * Deprecated: Use tp_text_channel_get_chat_state() instead. - */ -TpChannelChatState -tp_channel_get_chat_state (TpChannel *self, - TpHandle contact) -{ - gpointer value; - - g_return_val_if_fail (TP_IS_CHANNEL (self), 0); - - if (self->priv->chat_states != NULL && - g_hash_table_lookup_extended (self->priv->chat_states, - GUINT_TO_POINTER (contact), NULL, &value)) - { - return GPOINTER_TO_UINT (value); - } - - return TP_CHANNEL_CHAT_STATE_INACTIVE; -} - /* These functions, maybe_set_whatever, ignore attempts to set a null value. * This means we can indiscriminately set everything from every source @@ -659,72 +604,6 @@ _tp_channel_abort_introspection (TpChannel *self, tp_proxy_invalidate ((TpProxy *) self, error); } -static void -tp_channel_chat_state_changed_cb (TpChannel *self, - guint contact, - guint state, - gpointer unused G_GNUC_UNUSED, - GObject *object G_GNUC_UNUSED) -{ - g_hash_table_insert (self->priv->chat_states, - GUINT_TO_POINTER (contact), GUINT_TO_POINTER (state)); - - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - /* Don't emit the signal until we've had the initial state */ - if (!tp_proxy_is_prepared (self, TP_CHANNEL_FEATURE_CHAT_STATES)) - return; - G_GNUC_END_IGNORE_DEPRECATIONS - - g_signal_emit (self, signals[SIGNAL_CHAT_STATE_CHANGED], 0, contact, state); -} - -static void -tp_channel_get_initial_chat_states_cb (TpProxy *proxy, - const GValue *value, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - TpChannel *self = TP_CHANNEL (proxy); - GSimpleAsyncResult *result = user_data; - - if (error == NULL && G_VALUE_HOLDS (value, TP_HASH_TYPE_CHAT_STATE_MAP)) - { - tp_g_hash_table_update (self->priv->chat_states, - g_value_get_boxed (value), NULL, NULL); - } - /* else just ignore it and assume everyone was initially in the default - * Inactive state, unless we already saw a signal for them */ - - g_simple_async_result_complete (result); -} - -static void -tp_channel_prepare_chat_states_async (TpProxy *proxy, - const TpProxyFeature *feature, - GAsyncReadyCallback callback, - gpointer user_data) -{ - TpChannel *self = (TpChannel *) proxy; - GSimpleAsyncResult *result; - - result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, - tp_channel_prepare_chat_states_async); - - g_assert (self->priv->chat_states == NULL); - - /* chat states? yes please! */ - self->priv->chat_states = g_hash_table_new (NULL, NULL); - tp_cli_channel_interface_chat_state_connect_to_chat_state_changed ( - self, tp_channel_chat_state_changed_cb, NULL, NULL, NULL, - NULL); - - tp_cli_dbus_properties_call_get (self, -1, - TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE, "ChatStates", - tp_channel_get_initial_chat_states_cb, - result, g_object_unref, NULL); -} - void _tp_channel_continue_introspection (TpChannel *self) { @@ -1136,7 +1015,6 @@ tp_channel_finalize (GObject *object) g_clear_error (&self->priv->group_remove_error); tp_clear_pointer (&self->priv->introspect_needed, g_queue_free); - tp_clear_pointer (&self->priv->chat_states, g_hash_table_unref); tp_clear_pointer (&self->priv->channel_properties, g_hash_table_unref); tp_clear_pointer (&self->priv->contacts_queue, g_queue_free); @@ -1215,7 +1093,6 @@ tp_channel_prepare_password_async (TpProxy *proxy, enum { FEAT_CORE, FEAT_GROUP, - FEAT_CHAT_STATES, FEAT_PASSWORD, N_FEAT }; @@ -1224,7 +1101,6 @@ static const TpProxyFeature * tp_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; - static GQuark need_chat_states[2] = {0, 0}; static GQuark need_password[2] = {0, 0}; if (G_LIKELY (features[0].name != 0)) @@ -1237,14 +1113,6 @@ tp_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) features[FEAT_GROUP].prepare_async = _tp_channel_group_prepare_async; - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - features[FEAT_CHAT_STATES].name = TP_CHANNEL_FEATURE_CHAT_STATES; - features[FEAT_CHAT_STATES].prepare_async = - tp_channel_prepare_chat_states_async; - need_chat_states[0] = TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE; - features[FEAT_CHAT_STATES].interfaces_needed = need_chat_states; - G_GNUC_END_IGNORE_DEPRECATIONS - features[FEAT_PASSWORD].name = TP_CHANNEL_FEATURE_PASSWORD; features[FEAT_PASSWORD].prepare_async = tp_channel_prepare_password_async; @@ -1431,25 +1299,6 @@ tp_channel_class_init (TpChannelClass *klass) G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); /** - * TpChannel::chat-state-changed: - * @self: a channel - * @contact: a contact handle for the local user or another contact - * @state: the new #TpChannelChatState for the contact - * - * Emitted when a contact's chat state changes after tp_proxy_prepare_async() - * has finished preparing the feature %TP_CHANNEL_FEATURE_CHAT_STATES. - * - * Since: 0.11.3 - * Deprecated: Use #TpTextChannel::contact-chat-state-changed instead - */ - signals[SIGNAL_CHAT_STATE_CHANGED] = g_signal_new ("chat-state-changed", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, NULL, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); - - /** * TpChannel:target-contact: * * If this channel is for communication with a single contact (that is, diff --git a/telepathy-glib/channel.h b/telepathy-glib/channel.h index 80f97601c..ffb2e37cf 100644 --- a/telepathy-glib/channel.h +++ b/telepathy-glib/channel.h @@ -167,15 +167,6 @@ gboolean tp_channel_join_finish (TpChannel *self, GAsyncResult *result, GError **error); -#define TP_CHANNEL_FEATURE_CHAT_STATES \ - tp_channel_get_feature_quark_chat_states () -_TP_DEPRECATED_IN_0_20_FOR(tp_text_channel_get_feature_quark_chat_states) -GQuark tp_channel_get_feature_quark_chat_states (void) G_GNUC_CONST; - -_TP_DEPRECATED_IN_0_20_FOR(tp_text_channel_get_chat_state) -TpChannelChatState tp_channel_get_chat_state (TpChannel *self, - TpHandle contact); - /* Channel.Interface.Password */ #define TP_CHANNEL_FEATURE_PASSWORD \ tp_channel_get_feature_quark_password () diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c index a42011741..c41c37e26 100644 --- a/telepathy-glib/text-channel.c +++ b/telepathy-glib/text-channel.c @@ -88,6 +88,9 @@ struct _TpTextChannelPrivate gboolean is_sms_channel; gboolean sms_flash; + + /* TpHandle => TpChannelChatState */ + GHashTable *chat_states; }; enum @@ -105,7 +108,7 @@ enum /* signals */ SIG_MESSAGE_RECEIVED, SIG_PENDING_MESSAGE_REMOVED, SIG_MESSAGE_SENT, - SIG_CONTACT_CHAT_STATE_CHANGED, + SIG_CHAT_STATE_CHANGED, LAST_SIGNAL }; @@ -122,6 +125,8 @@ tp_text_channel_dispose (GObject *obj) g_queue_foreach (self->priv->pending_messages, (GFunc) g_object_unref, NULL); tp_clear_pointer (&self->priv->pending_messages, g_queue_free); + tp_clear_pointer (&self->priv->chat_states, g_hash_table_unref); + G_OBJECT_CLASS (tp_text_channel_parent_class)->dispose (obj); } @@ -328,39 +333,82 @@ message_sent_cb (TpChannel *channel, } static void -chat_state_changed_cb (TpTextChannel *self, +chat_state_changed_cb (TpChannel *channel, TpHandle handle, - TpChannelChatState state) + TpChannelChatState state, + gpointer user_data, + GObject *weak_object) { + TpTextChannel *self = (TpTextChannel *) channel; TpConnection *conn; TpContact *contact; - /* We have only an handle, but since we guarantee "contact-chat-state-changed" - * to be emitted only if TP_CHANNEL_FEATURE_GROUP and - * TP_CHANNEL_FEATURE_CONTACTS has been prepared, we should already have its - * TpContact. If the TpContact does not exist, telling its chat state is - * useless anyway. */ - conn = tp_channel_borrow_connection ((TpChannel *) self); + /* Ignore signal if we did not receive initial states */ + if (self->priv->chat_states == NULL) + return; + + g_hash_table_insert (self->priv->chat_states, + GUINT_TO_POINTER (handle), + GUINT_TO_POINTER (state)); + + /* We have only an handle, but since we guarantee "chat-state-changed" + * to be emitted only if TP_CHANNEL_FEATURE_GROUP has been prepared, we should + * already have its TpContact. If the TpContact does not exist, telling its + * chat state is useless anyway. */ + conn = tp_channel_borrow_connection (channel); contact = tp_connection_dup_contact_if_possible (conn, handle, NULL); if (contact == NULL) return; - g_signal_emit (self, signals[SIG_CONTACT_CHAT_STATE_CHANGED], 0, - contact, state); + g_signal_emit (self, signals[SIG_CHAT_STATE_CHANGED], 0, contact, state); g_object_unref (contact); } static void +got_chat_states_cb (TpProxy *proxy, + const GValue *value, + const GError *error, + gpointer user_data, + GObject *weak_object) +{ + TpTextChannel *self = (TpTextChannel *) proxy; + GSimpleAsyncResult *result = user_data; + + self->priv->chat_states = g_hash_table_new (NULL, NULL); + + if (error == NULL && G_VALUE_HOLDS (value, TP_HASH_TYPE_CHAT_STATE_MAP)) + { + tp_g_hash_table_update (self->priv->chat_states, + g_value_get_boxed (value), NULL, NULL); + } + /* else just ignore it and assume everyone was initially in the default + * Inactive state. */ + + g_simple_async_result_complete (result); +} + +static void tp_text_channel_prepare_chat_states_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { - /* This feature depends on TP_CHANNEL_FEATURE_CHAT_STATES so it's already - * prepared. */ - tp_simple_async_report_success_in_idle ((GObject *) proxy, - callback, user_data, tp_text_channel_prepare_chat_states_async); + TpChannel *channel = (TpChannel *) proxy; + GSimpleAsyncResult *result; + GError *error; + + result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, + tp_text_channel_prepare_chat_states_async); + + tp_cli_channel_interface_chat_state_connect_to_chat_state_changed (channel, + chat_state_changed_cb, NULL, NULL, NULL, &error); + g_assert_no_error (error); + + tp_cli_dbus_properties_call_get (channel, -1, + TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE, "ChatStates", + got_chat_states_cb, + result, g_object_unref, NULL); } static void @@ -390,11 +438,6 @@ tp_text_channel_constructed (GObject *obj) return; } - /* Forward TpChannel::chat-state-changed as - * TpTextChannel::contact-chat-state-changed */ - g_signal_connect (self, "chat-state-changed", - G_CALLBACK (chat_state_changed_cb), NULL); - props = tp_channel_borrow_immutable_properties (TP_CHANNEL (self)); self->priv->supported_content_types = (GStrv) tp_asv_get_strv (props, @@ -807,7 +850,7 @@ tp_text_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; static GQuark need_sms[2] = {0, 0}; - static GQuark depends_chat_state[2] = {0, 0}; + static GQuark need_chat_states[2] = {0, 0}; if (G_LIKELY (features[0].name != 0)) return features; @@ -824,14 +867,12 @@ tp_text_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) need_sms[0] = TP_IFACE_QUARK_CHANNEL_INTERFACE_SMS; features[FEAT_SMS].interfaces_needed = need_sms; - G_GNUC_BEGIN_IGNORE_DEPRECATIONS features[FEAT_CHAT_STATES].name = TP_TEXT_CHANNEL_FEATURE_CHAT_STATES; features[FEAT_CHAT_STATES].prepare_async = tp_text_channel_prepare_chat_states_async; - depends_chat_state[0] = TP_CHANNEL_FEATURE_CHAT_STATES; - features[FEAT_CHAT_STATES].depends_on = depends_chat_state; - G_GNUC_END_IGNORE_DEPRECATIONS + need_chat_states[0] = TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE; + features[FEAT_CHAT_STATES].interfaces_needed = need_chat_states; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); @@ -1034,19 +1075,22 @@ tp_text_channel_class_init (TpTextChannelClass *klass) g_type_class_add_private (gobject_class, sizeof (TpTextChannelPrivate)); /** - * TpTextChannel::contact-chat-state-changed: + * TpTextChannel::chat-state-changed: * @self: a channel * @contact: a #TpContact for the local user or another contact * @state: the new #TpChannelChatState for the contact * * Emitted when a contact's chat state changes after tp_proxy_prepare_async() - * has finished preparing features %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, - * %TP_CHANNEL_FEATURE_GROUP and %TP_CHANNEL_FEATURE_CONTACTS. + * has finished preparing features %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES. + * + * For group chats, it is not guaranteed this signal will be emitted for every + * members, until %TP_CHANNEL_FEATURE_GROUP has ben prepared using + * tp_proxy_prepare_async(). * - * Since: 0.19.0 + * Since: 0.UNRELEASED */ - signals[SIG_CONTACT_CHAT_STATE_CHANGED] = g_signal_new ( - "contact-chat-state-changed", + signals[SIG_CHAT_STATE_CHANGED] = g_signal_new ( + "chat-state-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, @@ -1559,13 +1603,21 @@ TpChannelChatState tp_text_channel_get_chat_state (TpTextChannel *self, TpContact *contact) { + gpointer value; + TpHandle handle; + g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), 0); - /* Use the deprecated function internally to avoid duplicated introspection */ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - return tp_channel_get_chat_state ((TpChannel *) self, - tp_contact_get_handle (contact)); - G_GNUC_END_IGNORE_DEPRECATIONS + handle = tp_contact_get_handle (contact); + + if (self->priv->chat_states != NULL && + g_hash_table_lookup_extended (self->priv->chat_states, + GUINT_TO_POINTER (handle), NULL, &value)) + { + return GPOINTER_TO_UINT (value); + } + + return TP_CHANNEL_CHAT_STATE_INACTIVE; } static void diff --git a/tests/dbus/channel-introspect.c b/tests/dbus/channel-introspect.c index d1df0d1c3..5d3de2027 100644 --- a/tests/dbus/channel-introspect.c +++ b/tests/dbus/channel-introspect.c @@ -108,8 +108,6 @@ main (int argc, TpHandle handle; GHashTable *asv; GAsyncResult *prepare_result; - GQuark chat_states_features[] = { TP_CHANNEL_FEATURE_CORE, - TP_CHANNEL_FEATURE_CHAT_STATES, 0 }; GQuark group_features[] = { TP_CHANNEL_FEATURE_GROUP, 0 }; g_type_init (); @@ -161,20 +159,15 @@ main (int argc, g_assert_no_error (error); prepare_result = NULL; - tp_proxy_prepare_async (chan, chat_states_features, channel_prepared_cb, - &prepare_result); + tp_proxy_prepare_async (chan, NULL, channel_prepared_cb, &prepare_result); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, FALSE); - g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), - ==, FALSE); tp_tests_proxy_run_until_prepared (chan, NULL); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, TRUE); - g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), - ==, FALSE); if (prepare_result == NULL) g_main_loop_run (mainloop); @@ -189,11 +182,10 @@ main (int argc, tp_handle_inspect (contact_repo, service_conn_as_base->self_handle)); /* no way to see what this is doing - just make sure it doesn't crash */ - tp_proxy_prepare_async (chan, chat_states_features, NULL, NULL); + tp_proxy_prepare_async (chan, NULL, NULL, NULL); prepare_result = NULL; - tp_proxy_prepare_async (chan, chat_states_features, channel_prepared_cb, - &prepare_result); + tp_proxy_prepare_async (chan, NULL, channel_prepared_cb, &prepare_result); if (prepare_result == NULL) g_main_loop_run (mainloop); @@ -396,8 +388,7 @@ main (int argc, g_assert_no_error (error); prepare_result = NULL; - tp_proxy_prepare_async (chan, chat_states_features, channel_prepared_cb, - &prepare_result); + tp_proxy_prepare_async (chan, NULL, channel_prepared_cb, &prepare_result); g_assert (prepare_result == NULL); g_main_loop_run (mainloop); MYASSERT (tp_proxy_prepare_finish (chan, prepare_result, &error), ""); @@ -407,20 +398,15 @@ main (int argc, g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, TRUE); - g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), - ==, FALSE); tp_tests_connection_assert_disconnect_succeeds (conn); prepare_result = NULL; - tp_proxy_prepare_async (chan, chat_states_features, channel_prepared_cb, - &prepare_result); + tp_proxy_prepare_async (chan, NULL, channel_prepared_cb, &prepare_result); /* is_prepared becomes FALSE because the channel broke */ g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, FALSE); - g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), - ==, FALSE); g_assert_error (tp_proxy_get_invalidated (chan), TP_ERROR, TP_ERROR_CANCELLED); diff --git a/tests/dbus/text-channel.c b/tests/dbus/text-channel.c index 3656d815f..d946a18e1 100644 --- a/tests/dbus/text-channel.c +++ b/tests/dbus/text-channel.c @@ -984,7 +984,7 @@ set_chat_state_cb (GObject *source, } static void -contact_chat_state_changed_cb (TpTextChannel *channel, +chat_state_changed_cb (TpTextChannel *channel, TpContact *contact, TpChannelChatState state, Test *test) @@ -1031,8 +1031,8 @@ test_chat_state (Test *test, /* Now set a valid chat state and verify self contact has that state */ tp_text_channel_set_chat_state_async (test->channel, TP_CHANNEL_CHAT_STATE_COMPOSING, set_chat_state_cb, test); - g_signal_connect (test->channel, "contact-chat-state-changed", - G_CALLBACK (contact_chat_state_changed_cb), test); + g_signal_connect (test->channel, "chat-state-changed", + G_CALLBACK (chat_state_changed_cb), test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); |