From b15c53e7e8b21fcfb4e6c43e0740866a6c2a5130 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Thu, 13 Aug 2009 12:10:01 +0100 Subject: Only call SetChatState if the Channel supports it I'm sick of seeing spurious debug messages about this whenever I type anything into an IRC channel. --- libempathy/empathy-tp-chat.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index a3282818f..9300364d5 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -1328,13 +1328,16 @@ empathy_tp_chat_set_state (EmpathyTpChat *chat, g_return_if_fail (EMPATHY_IS_TP_CHAT (chat)); g_return_if_fail (priv->ready); - DEBUG ("Set state: %d", state); - tp_cli_channel_interface_chat_state_call_set_chat_state (priv->channel, -1, - state, - tp_chat_async_cb, - "setting chat state", - NULL, - G_OBJECT (chat)); + if (tp_proxy_has_interface_by_id (priv->channel, + TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE)) { + DEBUG ("Set state: %d", state); + tp_cli_channel_interface_chat_state_call_set_chat_state (priv->channel, -1, + state, + tp_chat_async_cb, + "setting chat state", + NULL, + G_OBJECT (chat)); + } } -- cgit v1.2.3