[empathy] tp-chat: add the 'members-changed' signal



commit 55b19d4afad4a05e4e90ab4e4a57bbb1e2734d21
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Apr 26 13:42:03 2012 +0200

    tp-chat: add the 'members-changed' signal
    
    It uses to be implemented by the EmpathyContactList interface which has been
    removed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674864

 libempathy/empathy-tp-chat.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 29618cb..4069da4 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -82,6 +82,7 @@ enum
   CHAT_STATE_CHANGED,
   MESSAGE_ACKNOWLEDGED,
   SIG_MEMBER_RENAMED,
+  SIG_MEMBERS_CHANGED,
   LAST_SIGNAL
 };
 
@@ -855,7 +856,7 @@ tp_chat_got_added_contacts_cb (TpConnection *connection,
         {
           self->priv->members = g_list_prepend (self->priv->members,
             g_object_ref (contact));
-          g_signal_emit_by_name (chat, "members-changed",
+          g_signal_emit (self, signals[SIG_MEMBERS_CHANGED], 0,
                      contact, NULL, 0, NULL, TRUE);
         }
     }
@@ -1040,9 +1041,8 @@ tp_chat_group_members_changed_cb (TpChannel *channel,
 
       if (contact != NULL)
         {
-          g_signal_emit_by_name (self, "members-changed", contact,
-                     actor_contact, reason, message,
-                     FALSE);
+          g_signal_emit (self, signals[SIG_MEMBERS_CHANGED], 0,
+                     contact, actor_contact, reason, message, FALSE);
           g_object_unref (contact);
         }
     }
@@ -1289,6 +1289,14 @@ empathy_tp_chat_class_init (EmpathyTpChatClass *klass)
       4, EMPATHY_TYPE_CONTACT, EMPATHY_TYPE_CONTACT,
       G_TYPE_UINT, G_TYPE_STRING);
 
+  signals[SIG_MEMBERS_CHANGED] = g_signal_new ("members-changed",
+      G_OBJECT_CLASS_TYPE (klass),
+      G_SIGNAL_RUN_LAST,
+      0, NULL, NULL, NULL,
+      G_TYPE_NONE,
+      5, EMPATHY_TYPE_CONTACT, EMPATHY_TYPE_CONTACT,
+      G_TYPE_UINT, G_TYPE_STRING, G_TYPE_BOOLEAN);
+
   g_type_class_add_private (object_class, sizeof (EmpathyTpChatPrivate));
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]