]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-tp-chatroom.c
Rename all filenames starting with "gossip" by "empathy", change namespace
[empathy.git] / libempathy / empathy-tp-chatroom.c
index 232db30fda1b6383c3fa01bca126b7c0f252ca58..fe8e7f8e75b294ddbacd1416c4f14cda927a2737 100644 (file)
@@ -28,9 +28,9 @@
 #include "empathy-tp-contact-list.h"
 #include "empathy-contact-list.h"
 #include "empathy-contact-manager.h"
-#include "gossip-telepathy-group.h"
-#include "gossip-utils.h"
-#include "gossip-debug.h"
+#include "empathy-tp-group.h"
+#include "empathy-utils.h"
+#include "empathy-debug.h"
 
 #define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
                       EMPATHY_TYPE_TP_CHATROOM, EmpathyTpChatroomPriv))
 struct _EmpathyTpChatroomPriv {
        EmpathyContactManager *manager;
        EmpathyTpContactList  *list;
-       GossipTelepathyGroup  *group;
+       EmpathyTpGroup        *group;
 
        gboolean               is_invited;
-       GossipContact         *invitor;
+       EmpathyContact        *invitor;
        gchar                 *invit_message;
 };
 
@@ -51,26 +51,26 @@ static void            empathy_tp_chatroom_class_init (EmpathyTpChatroomClass  *
 static void            tp_chatroom_iface_init         (EmpathyContactListIface *iface);
 static void            empathy_tp_chatroom_init       (EmpathyTpChatroom       *chatroom);
 static void            tp_chatroom_finalize           (GObject                 *object);
-static void            tp_chatroom_members_added_cb   (GossipTelepathyGroup    *group,
+static void            tp_chatroom_members_added_cb   (EmpathyTpGroup          *group,
                                                       GArray                  *handles,
                                                       guint                    actor_handle,
                                                       guint                    reason,
                                                       const gchar             *message,
                                                       EmpathyTpChatroom       *list);
-static void            tp_chatroom_members_removed_cb (GossipTelepathyGroup    *group,
+static void            tp_chatroom_members_removed_cb (EmpathyTpGroup          *group,
                                                       GArray                  *handles,
                                                       guint                    actor_handle,
                                                       guint                    reason,
                                                       const gchar             *message,
                                                       EmpathyTpChatroom       *list);
 static void            tp_chatroom_setup              (EmpathyContactList      *list);
-static GossipContact * tp_chatroom_find               (EmpathyContactList      *list,
+static EmpathyContact * tp_chatroom_find               (EmpathyContactList      *list,
                                                       const gchar             *id);
 static void            tp_chatroom_add                (EmpathyContactList      *list,
-                                                      GossipContact           *contact,
+                                                      EmpathyContact           *contact,
                                                       const gchar             *message);
 static void            tp_chatroom_remove             (EmpathyContactList      *list,
-                                                      GossipContact           *contact,
+                                                      EmpathyContact           *contact,
                                                       const gchar             *message);
 static GList *         tp_chatroom_get_members        (EmpathyContactList      *list);
 
@@ -145,11 +145,11 @@ empathy_tp_chatroom_new (McAccount *account,
 
        priv = GET_PRIV (chatroom);
 
-       mc = gossip_mission_control_new ();
+       mc = empathy_mission_control_new ();
        tp_conn = mission_control_get_connection (mc, account, NULL);
        priv->manager = empathy_contact_manager_new ();
        priv->list = empathy_contact_manager_get_list (priv->manager, account);
-       priv->group = gossip_telepathy_group_new (tp_chan, tp_conn);
+       priv->group = empathy_tp_group_new (tp_chan, tp_conn);
 
        g_signal_connect (priv->group, "members-added",
                          G_CALLBACK (tp_chatroom_members_added_cb),
@@ -159,10 +159,10 @@ empathy_tp_chatroom_new (McAccount *account,
                          chatroom);
 
        /* Check if we are invited to join the chat */
-       self_handle = gossip_telepathy_group_get_self_handle (priv->group);
-       members = gossip_telepathy_group_get_local_pending_members_with_info (priv->group);
+       self_handle = empathy_tp_group_get_self_handle (priv->group);
+       members = empathy_tp_group_get_local_pending_members_with_info (priv->group);
        for (l = members; l; l = l->next) {
-               GossipTpGroupInfo *info;
+               EmpathyTpGroupInfo *info;
 
                info = l->data;
 
@@ -175,12 +175,12 @@ empathy_tp_chatroom_new (McAccount *account,
                priv->invit_message = g_strdup (info->message);
                priv->is_invited = TRUE;
 
-               gossip_debug (DEBUG_DOMAIN, "We are invited to join by %s: %s",
-                             gossip_contact_get_name (priv->invitor),
+               empathy_debug (DEBUG_DOMAIN, "We are invited to join by %s: %s",
+                             empathy_contact_get_name (priv->invitor),
                              priv->invit_message);
        }
 
-       gossip_telepathy_group_info_list_free (members);
+       empathy_tp_group_info_list_free (members);
        g_object_unref (mc);
        g_object_unref (tp_conn);
 
@@ -189,7 +189,7 @@ empathy_tp_chatroom_new (McAccount *account,
 
 gboolean
 empathy_tp_chatroom_get_invitation (EmpathyTpChatroom  *chatroom,
-                                   GossipContact     **contact,
+                                   EmpathyContact     **contact,
                                    const gchar       **message)
 {
        EmpathyTpChatroomPriv *priv;
@@ -228,8 +228,8 @@ empathy_tp_chatroom_accept_invitation (EmpathyTpChatroom *chatroom)
        priv->invit_message = NULL;
 
        /* Add ourself in the members of the room */
-       self_handle = gossip_telepathy_group_get_self_handle (priv->group);
-       gossip_telepathy_group_add_member (priv->group, self_handle,
+       self_handle = empathy_tp_group_get_self_handle (priv->group);
+       empathy_tp_group_add_member (priv->group, self_handle,
                                           "Just for fun");
 }
 
@@ -240,12 +240,12 @@ empathy_tp_chatroom_set_topic (EmpathyTpChatroom *chatroom,
 }
 
 static void
-tp_chatroom_members_added_cb (GossipTelepathyGroup *group,
-                             GArray               *handles,
-                             guint                 actor_handle,
-                             guint                 reason,
-                             const gchar          *message,
-                             EmpathyTpChatroom    *chatroom)
+tp_chatroom_members_added_cb (EmpathyTpGroup    *group,
+                             GArray            *handles,
+                             guint              actor_handle,
+                             guint              reason,
+                             const gchar       *message,
+                             EmpathyTpChatroom *chatroom)
 {
        EmpathyTpChatroomPriv *priv;
        GList                 *contacts, *l;
@@ -254,7 +254,7 @@ tp_chatroom_members_added_cb (GossipTelepathyGroup *group,
 
        contacts = empathy_tp_contact_list_get_from_handles (priv->list, handles);
        for (l = contacts; l; l = l->next) {
-               GossipContact *contact;
+               EmpathyContact *contact;
 
                contact = l->data;
 
@@ -266,12 +266,12 @@ tp_chatroom_members_added_cb (GossipTelepathyGroup *group,
 }
 
 static void
-tp_chatroom_members_removed_cb (GossipTelepathyGroup *group,
-                               GArray               *handles,
-                               guint                 actor_handle,
-                               guint                 reason,
-                               const gchar          *message,
-                               EmpathyTpChatroom    *chatroom)
+tp_chatroom_members_removed_cb (EmpathyTpGroup    *group,
+                               GArray            *handles,
+                               guint              actor_handle,
+                               guint              reason,
+                               const gchar       *message,
+                               EmpathyTpChatroom *chatroom)
 {
        EmpathyTpChatroomPriv *priv;
        GList                 *contacts, *l;
@@ -280,7 +280,7 @@ tp_chatroom_members_removed_cb (GossipTelepathyGroup *group,
 
        contacts = empathy_tp_contact_list_get_from_handles (priv->list, handles);
        for (l = contacts; l; l = l->next) {
-               GossipContact *contact;
+               EmpathyContact *contact;
 
                contact = l->data;
 
@@ -297,7 +297,7 @@ tp_chatroom_setup (EmpathyContactList *list)
        /* Nothing to do */
 }
 
-static GossipContact *
+static EmpathyContact *
 tp_chatroom_find (EmpathyContactList *list,
                  const gchar        *id)
 {
@@ -306,36 +306,36 @@ tp_chatroom_find (EmpathyContactList *list,
 
 static void
 tp_chatroom_add (EmpathyContactList *list,
-                GossipContact      *contact,
+                EmpathyContact     *contact,
                 const gchar        *message)
 {
        EmpathyTpChatroomPriv *priv;
 
        g_return_if_fail (EMPATHY_IS_TP_CHATROOM (list));
-       g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+       g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
        priv = GET_PRIV (list);
 
-       gossip_telepathy_group_add_member (priv->group,
-                                          gossip_contact_get_handle (contact),
-                                          message);
+       empathy_tp_group_add_member (priv->group,
+                                    empathy_contact_get_handle (contact),
+                                    message);
 }
 
 static void
 tp_chatroom_remove (EmpathyContactList *list,
-                   GossipContact      *contact,
+                   EmpathyContact     *contact,
                    const gchar        *message)
 {
        EmpathyTpChatroomPriv *priv;
 
        g_return_if_fail (EMPATHY_IS_TP_CHATROOM (list));
-       g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+       g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
        priv = GET_PRIV (list);
 
-       gossip_telepathy_group_remove_member (priv->group,
-                                             gossip_contact_get_handle (contact),
-                                             message);
+       empathy_tp_group_remove_member (priv->group,
+                                       empathy_contact_get_handle (contact),
+                                       message);
 }
 
 static GList *
@@ -349,7 +349,7 @@ tp_chatroom_get_members (EmpathyContactList *list)
 
        priv = GET_PRIV (list);
 
-       members = gossip_telepathy_group_get_members (priv->group);
+       members = empathy_tp_group_get_members (priv->group);
        contacts = empathy_tp_contact_list_get_from_handles (priv->list, members);
        g_array_free (members, TRUE);