aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-group-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-08-31 00:49:52 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-08-31 00:49:52 +0800
commit0b0bb0f621d8e1cda1508d9062a279459fc3b955 (patch)
tree03ad0e8b2180f5e3d6821fbab6315b33c7baf4d8 /libempathy-gtk/empathy-group-chat.c
parent3a535643a694d0dd1bed8e0b7a2fd6fd21e6ee0c (diff)
downloadgsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.gz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.bz2
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.lz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.xz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.zst
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.zip
Completely reworked ContactList API. Fixes bug #471611, bug #467280, bug #459540 and bug #462907.
svn path=/trunk/; revision=280
Diffstat (limited to 'libempathy-gtk/empathy-group-chat.c')
-rw-r--r--libempathy-gtk/empathy-group-chat.c49
1 files changed, 20 insertions, 29 deletions
diff --git a/libempathy-gtk/empathy-group-chat.c b/libempathy-gtk/empathy-group-chat.c
index ca046a3d7..48439302d 100644
--- a/libempathy-gtk/empathy-group-chat.c
+++ b/libempathy-gtk/empathy-group-chat.c
@@ -78,11 +78,12 @@ static void group_chat_finalize (GObject *obj
static void group_chat_create_ui (EmpathyGroupChat *chat);
static void group_chat_widget_destroy_cb (GtkWidget *widget,
EmpathyGroupChat *chat);
-static void group_chat_contact_added_cb (EmpathyTpChatroom *tp_chat,
- EmpathyContact *contact,
- EmpathyGroupChat *chat);
-static void group_chat_contact_removed_cb (EmpathyTpChatroom *tp_chat,
+static void group_chat_members_changed_cb (EmpathyTpChatroom *tp_chat,
EmpathyContact *contact,
+ EmpathyContact *actor,
+ guint reason,
+ gchar *message,
+ gboolean is_member,
EmpathyGroupChat *chat);
static void group_chat_topic_entry_activate_cb (GtkWidget *entry,
GtkDialog *dialog);
@@ -348,33 +349,26 @@ group_chat_widget_destroy_cb (GtkWidget *widget,
}
static void
-group_chat_contact_added_cb (EmpathyTpChatroom *tp_chat,
- EmpathyContact *contact,
- EmpathyGroupChat *chat)
-{
- EmpathyGroupChatPriv *priv;
- gchar *str;
-
- priv = GET_PRIV (chat);
-
- str = g_strdup_printf (_("%s has joined the room"),
- empathy_contact_get_name (contact));
- empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
- g_free (str);
-}
-
-static void
-group_chat_contact_removed_cb (EmpathyTpChatroom *tp_chat,
+group_chat_members_changed_cb (EmpathyTpChatroom *tp_chat,
EmpathyContact *contact,
+ EmpathyContact *actor,
+ guint reason,
+ gchar *message,
+ gboolean is_member,
EmpathyGroupChat *chat)
{
EmpathyGroupChatPriv *priv;
- gchar *str;
+ gchar *str;
priv = GET_PRIV (chat);
- str = g_strdup_printf (_("%s has left the room"),
- empathy_contact_get_name (contact));
+ if (is_member) {
+ str = g_strdup_printf (_("%s has joined the room"),
+ empathy_contact_get_name (contact));
+ } else {
+ str = g_strdup_printf (_("%s has left the room"),
+ empathy_contact_get_name (contact));
+ }
empathy_chat_view_append_event (EMPATHY_CHAT (chat)->view, str);
g_free (str);
}
@@ -540,11 +534,8 @@ group_chat_set_tp_chat (EmpathyChat *chat,
gtk_widget_show (GTK_WIDGET (priv->view));
/* Connect signals */
- g_signal_connect (priv->tp_chat, "contact-added",
- G_CALLBACK (group_chat_contact_added_cb),
- chat);
- g_signal_connect (priv->tp_chat, "contact-removed",
- G_CALLBACK (group_chat_contact_removed_cb),
+ g_signal_connect (priv->tp_chat, "members-changed",
+ G_CALLBACK (group_chat_members_changed_cb),
chat);
g_signal_connect (priv->tp_chat, "notify::subject",
G_CALLBACK (group_chat_subject_notify_cb),