aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 07bd35711..cc946b1e1 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -1791,6 +1791,8 @@ chat_members_changed_cb (EmpathyTpChat *tp_chat,
gboolean is_member,
EmpathyChat *chat)
{
+ g_return_if_fail (TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED != reason);
+
EmpathyChatPriv *priv = GET_PRIV (chat);
const gchar *name = empathy_contact_get_name (contact);
gchar *str;
@@ -1809,6 +1811,30 @@ chat_members_changed_cb (EmpathyTpChat *tp_chat,
g_free (str);
}
+static void
+chat_member_renamed_cb (EmpathyTpChat *tp_chat,
+ EmpathyContact *old_contact,
+ EmpathyContact *new_contact,
+ guint reason,
+ gchar *message,
+ EmpathyChat *chat)
+{
+ g_return_if_fail (TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED == reason);
+
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+
+ if (priv->block_events_timeout_id == 0) {
+ gchar *str;
+
+ str = g_strdup_printf (_("%s is now known as %s"),
+ empathy_contact_get_name (old_contact),
+ empathy_contact_get_name (new_contact));
+ empathy_chat_view_append_event (chat->view, str);
+ g_free (str);
+ }
+
+}
+
static gboolean
chat_reset_size_request (gpointer widget)
{
@@ -2536,6 +2562,9 @@ empathy_chat_set_tp_chat (EmpathyChat *chat,
g_signal_connect (tp_chat, "members-changed",
G_CALLBACK (chat_members_changed_cb),
chat);
+ g_signal_connect (tp_chat, "member-renamed",
+ G_CALLBACK (chat_member_renamed_cb),
+ chat);
g_signal_connect_swapped (tp_chat, "notify::remote-contact",
G_CALLBACK (chat_remote_contact_changed_cb),
chat);