]> git.0d.be Git - empathy.git/commitdiff
implement empathy_tp_chat_add as a method on TpChat
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 10 Apr 2012 11:15:07 +0000 (13:15 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 10 Apr 2012 11:31:49 +0000 (13:31 +0200)
We want to get rid of the EmpathyContactList interface.

https://bugzilla.gnome.org/show_bug.cgi?id=673821

libempathy-gtk/empathy-individual-menu.c
libempathy/empathy-tp-chat.c
libempathy/empathy-tp-chat.h
src/empathy-chat-window.c

index 22d3148827588a280dd77bd0e9b68b8d50e8fd0a..478170fb378effcd97c0b11381034c2e5d24c314 100644 (file)
@@ -1560,8 +1560,7 @@ room_sub_menu_activate_cb (GtkWidget *item,
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
   /* send invitation */
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
   /* send invitation */
-  empathy_contact_list_add (EMPATHY_CONTACT_LIST (chat),
-      contact, _("Inviting you to this room"));
+  empathy_tp_chat_add (chat, contact, _("Inviting you to this room"));
 
 out:
   g_object_unref (contact);
 
 out:
   g_object_unref (contact);
index f3a3aa83234a95c0ef30a12176b408855713b4e1..28c0e2a19ec666a8040a4eb735f4dea6822098fb 100644 (file)
@@ -157,12 +157,11 @@ create_conference_cb (GObject *source,
     }
 }
 
     }
 }
 
-static void
-tp_chat_add (EmpathyContactList *list,
+void
+empathy_tp_chat_add (EmpathyTpChat *self,
     EmpathyContact *contact,
     const gchar *message)
 {
     EmpathyContact *contact,
     const gchar *message)
 {
-  EmpathyTpChat *self = (EmpathyTpChat *) list;
   TpChannel *channel = (TpChannel *) self;
 
   if (tp_proxy_has_interface_by_id (self,
   TpChannel *channel = (TpChannel *) self;
 
   if (tp_proxy_has_interface_by_id (self,
@@ -171,7 +170,6 @@ tp_chat_add (EmpathyContactList *list,
       TpHandle handle;
       GArray handles = {(gchar *) &handle, 1};
 
       TpHandle handle;
       GArray handles = {(gchar *) &handle, 1};
 
-      g_return_if_fail (EMPATHY_IS_TP_CHAT (list));
       g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
       handle = empathy_contact_get_handle (contact);
       g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
       handle = empathy_contact_get_handle (contact);
@@ -1326,7 +1324,6 @@ empathy_tp_chat_init (EmpathyTpChat *self)
 static void
 tp_chat_iface_init (EmpathyContactListIface *iface)
 {
 static void
 tp_chat_iface_init (EmpathyContactListIface *iface)
 {
-  iface->add = tp_chat_add;
   iface->remove = tp_chat_remove;
   iface->get_members = tp_chat_get_members;
 }
   iface->remove = tp_chat_remove;
   iface->get_members = tp_chat_get_members;
 }
index 7da675c3297313d8b98f24fc99ff9db2aae6f41c..adb2ee1c55f4a7437bbd1753e2b44d4ebbf52170 100644 (file)
@@ -103,6 +103,10 @@ TpChannelChatState empathy_tp_chat_get_chat_state (EmpathyTpChat *chat,
 
 EmpathyContact * empathy_tp_chat_get_self_contact (EmpathyTpChat *self);
 
 
 EmpathyContact * empathy_tp_chat_get_self_contact (EmpathyTpChat *self);
 
+void empathy_tp_chat_add (EmpathyTpChat *self,
+    EmpathyContact *contact,
+    const gchar *message);
+
 G_END_DECLS
 
 #endif /* __EMPATHY_TP_CHAT_H__ */
 G_END_DECLS
 
 #endif /* __EMPATHY_TP_CHAT_H__ */
index ac3584f34d2ddfca1e4553e28eae913fde6694b4..0d49fcb89c05e4fb6a9d7bcbde7a107284775620 100644 (file)
@@ -1188,8 +1188,7 @@ chat_window_invite_participant_activate_cb (GtkAction         *action,
 
                contact = empathy_contact_dup_from_tp_contact (tp_contact);
 
 
                contact = empathy_contact_dup_from_tp_contact (tp_contact);
 
-               empathy_contact_list_add (EMPATHY_CONTACT_LIST (tp_chat),
-                               contact, _("Inviting you to this room"));
+               empathy_tp_chat_add (tp_chat, contact, _("Inviting you to this room"));
 
                g_object_unref (contact);
        }
 
                g_object_unref (contact);
        }
@@ -2045,7 +2044,7 @@ drag_data_received_individual_id (EmpathyChatWindow *self,
                        tp_channel_get_identifier ((TpChannel *) chat));
 
        contact = empathy_contact_dup_from_tp_contact (tp_contact);
                        tp_channel_get_identifier ((TpChannel *) chat));
 
        contact = empathy_contact_dup_from_tp_contact (tp_contact);
-       empathy_contact_list_add (EMPATHY_CONTACT_LIST (chat), contact, NULL);
+       empathy_tp_chat_add (chat, contact, NULL);
        g_object_unref (contact);
 
 out:
        g_object_unref (contact);
 
 out: