]> git.0d.be Git - empathy.git/commitdiff
empathy-tp-chat: ensure that we get a TpTextChannel
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 15 Apr 2011 10:21:52 +0000 (12:21 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 18 Apr 2011 11:09:48 +0000 (13:09 +0200)
libempathy/empathy-chatroom-manager.c
libempathy/empathy-tp-chat.c
src/empathy-chat-manager.c
src/empathy-event-manager.c

index dd7ef460e22e1d6ed3b0bd171da4284751709ce3..9ad75ee03269b1e07ca3494f658aad193c8fd92d 100644 (file)
@@ -873,6 +873,9 @@ observe_channels_cb (TpSimpleObserver *observer,
       if (tp_proxy_get_invalidated (channel) != NULL)
         continue;
 
+      if (!TP_IS_TEXT_CHANNEL (channel))
+        continue;
+
       tp_chat = empathy_tp_chat_new (account, channel);
       roomname = empathy_tp_chat_get_id (tp_chat);
       chatroom = empathy_chatroom_manager_find (self, account, roomname);
index 1b2fe46b742765afd79f077cc665fccb02f05601..8c09529b7cc87eb256181fe53bb07e1ff1139466 100644 (file)
@@ -1551,7 +1551,7 @@ empathy_tp_chat_new (TpAccount *account,
                     TpChannel *channel)
 {
        g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL);
-       g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
+       g_return_val_if_fail (TP_IS_TEXT_CHANNEL (channel), NULL);
 
        return g_object_new (EMPATHY_TYPE_TP_CHAT,
                             "account", account,
index ff715fe375acab2604cd76be1efcb342befb024e..6c92c25cb4df8ab4b8b6e0d6dad17fa31828b758 100644 (file)
@@ -231,6 +231,13 @@ handle_channels (TpSimpleHandler *handler,
       if (tp_proxy_get_invalidated (channel) != NULL)
         continue;
 
+      if (!TP_IS_TEXT_CHANNEL (channel))
+        {
+          DEBUG ("Channel %s doesn't implement Messages; can't handle it",
+              tp_proxy_get_object_path (channel));
+          continue;
+        }
+
       handling = TRUE;
 
       tp_chat = empathy_tp_chat_new (account, channel);
index 342d3e11e3821c701b2935898f3fc37a342beb76..6125ec89597e57d9befb89e350566b9f1683e10e 100644 (file)
@@ -934,7 +934,7 @@ approve_channels (TpSimpleApprover *approver,
 
   channel_type = tp_channel_get_channel_type_id (channel);
 
-  if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_TEXT)
+  if (TP_IS_TEXT_CHANNEL (channel))
     {
       EmpathyTpChat *tp_chat;