diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2009-06-18 03:41:31 +0800 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-06-18 18:14:24 +0800 |
commit | bc08d45ad3b44b7ba7b5b0044f538338d2a6553e (patch) | |
tree | 8cc05f165f97e0fb8e9572599a61974b7c185e2e | |
parent | c007f0c68d7a40f658a238cc2316ccc545bef7c0 (diff) | |
download | gsoc2013-empathy-bc08d45ad3b44b7ba7b5b0044f538338d2a6553e.tar gsoc2013-empathy-bc08d45ad3b44b7ba7b5b0044f538338d2a6553e.tar.gz gsoc2013-empathy-bc08d45ad3b44b7ba7b5b0044f538338d2a6553e.tar.bz2 gsoc2013-empathy-bc08d45ad3b44b7ba7b5b0044f538338d2a6553e.tar.lz gsoc2013-empathy-bc08d45ad3b44b7ba7b5b0044f538338d2a6553e.tar.xz gsoc2013-empathy-bc08d45ad3b44b7ba7b5b0044f538338d2a6553e.tar.zst gsoc2013-empathy-bc08d45ad3b44b7ba7b5b0044f538338d2a6553e.zip |
Print part reasons to conversation window
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 0fb77f24c..e327b27d7 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -1165,14 +1165,48 @@ chat_members_changed_cb (EmpathyTpChat *tp_chat, EmpathyChatPriv *priv = GET_PRIV (chat); if (priv->block_events_timeout_id == 0) { + const gchar *name = empathy_contact_get_name (contact); gchar *str; if (is_member) { str = g_strdup_printf (_("%s has joined the room"), - empathy_contact_get_name (contact)); + name); } else { - str = g_strdup_printf (_("%s has left the room"), - empathy_contact_get_name (contact)); + const gchar *action; + + if (EMP_STR_EMPTY (message)) { + switch (reason) { + case TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE: + action = _("%s has disconnected"); + break; + case TP_CHANNEL_GROUP_CHANGE_REASON_KICKED: + action = _("%s was kicked"); + break; + case TP_CHANNEL_GROUP_CHANGE_REASON_BANNED: + action = _("%s was banned"); + break; + default: + action = _("%s has left the room"); + } + + str = g_strdup_printf (action, name); + } else { + switch (reason) { + case TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE: + action = _("%s has disconnected (%s)"); + break; + case TP_CHANNEL_GROUP_CHANGE_REASON_KICKED: + action = _("%s was kicked (%s)"); + break; + case TP_CHANNEL_GROUP_CHANGE_REASON_BANNED: + action = _("%s was banned (%s)"); + break; + default: + action = _("%s has left the room (%s)"); + } + + str = g_strdup_printf (action, name, message); + } } empathy_chat_view_append_event (chat->view, str); g_free (str); |