summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-01-14 10:44:20 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-12 12:30:39 +0200
commitd81a898ad5e4c86aa66c9b62e431c31aea017eca (patch)
treeb94e4234d19c51917447fd1d75e7a0dfd6404e0e
parent85097b3c3329c7c88199864b46dc78318b4e3640 (diff)
channel.c: simplify chat-states preparation
-rw-r--r--telepathy-glib/channel.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c
index fedd5a5b..e9c9939b 100644
--- a/telepathy-glib/channel.c
+++ b/telepathy-glib/channel.c
@@ -699,18 +699,11 @@ tp_channel_get_initial_chat_states_cb (TpProxy *proxy,
}
static void
-tp_channel_maybe_prepare_chat_states (TpProxy *proxy)
+tp_channel_prepare_chat_states (TpProxy *proxy)
{
TpChannel *self = (TpChannel *) proxy;
- if (self->priv->chat_states != NULL)
- return; /* already done */
-
- if (!_tp_proxy_is_preparing (proxy, TP_CHANNEL_FEATURE_CHAT_STATES))
- return; /* not interested right now */
-
- if (!self->priv->ready)
- return; /* will try again when ready */
+ g_assert (self->priv->chat_states == NULL);
/* chat states? yes please! */
self->priv->chat_states = g_hash_table_new (NULL, NULL);
@@ -755,8 +748,6 @@ _tp_channel_continue_introspection (TpChannel *self)
TP_CHANNEL_FEATURE_GROUP,
tp_proxy_has_interface_by_id (self,
TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP));
-
- tp_channel_maybe_prepare_chat_states ((TpProxy *) self);
}
else
{
@@ -1361,7 +1352,7 @@ tp_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED)
features[FEAT_CHAT_STATES].name = TP_CHANNEL_FEATURE_CHAT_STATES;
features[FEAT_CHAT_STATES].start_preparing =
- tp_channel_maybe_prepare_chat_states;
+ tp_channel_prepare_chat_states;
if (G_UNLIKELY (need_chat_states[0] == 0))
need_chat_states[0] = TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE;
features[FEAT_CHAT_STATES].interfaces_needed = need_chat_states;