aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-12-16 19:52:44 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-12-16 19:53:31 +0800
commit7d22de0340197c4578e4a7e1dd4c4d2e642ba689 (patch)
treea34fb3dab8842b35433ff9dfbd559d0c7a5b2095
parent9d7a9b0feb1f30f891625abeebf571288e2eba4d (diff)
downloadgsoc2013-empathy-7d22de0340197c4578e4a7e1dd4c4d2e642ba689.tar
gsoc2013-empathy-7d22de0340197c4578e4a7e1dd4c4d2e642ba689.tar.gz
gsoc2013-empathy-7d22de0340197c4578e4a7e1dd4c4d2e642ba689.tar.bz2
gsoc2013-empathy-7d22de0340197c4578e4a7e1dd4c4d2e642ba689.tar.lz
gsoc2013-empathy-7d22de0340197c4578e4a7e1dd4c4d2e642ba689.tar.xz
gsoc2013-empathy-7d22de0340197c4578e4a7e1dd4c4d2e642ba689.tar.zst
gsoc2013-empathy-7d22de0340197c4578e4a7e1dd4c4d2e642ba689.zip
import-widget: use the server in IRC account display name
User generally use the same nick on different servers so just displaying the nick isn't very useful. https://bugzilla.gnome.org/show_bug.cgi?id=654171
-rw-r--r--src/empathy-import-widget.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/empathy-import-widget.c b/src/empathy-import-widget.c
index 9a8917ffc..aaf20d5c5 100644
--- a/src/empathy-import-widget.c
+++ b/src/empathy-import-widget.c
@@ -200,7 +200,7 @@ import_widget_add_account (EmpathyImportWidget *self,
EmpathyImportAccountData *data)
{
TpAccountManager *account_manager;
- gchar *display_name;
+ gchar *display_name = NULL;
GHashTable *properties;
GValue *username;
@@ -210,9 +210,23 @@ import_widget_add_account (EmpathyImportWidget *self,
/* Set the display name of the account */
username = g_hash_table_lookup (data->settings, "account");
- display_name = g_strdup_printf ("%s (%s)",
- data->protocol,
- g_value_get_string (username));
+
+ if (!tp_strdiff (data->protocol, "irc"))
+ {
+ const gchar *server;
+
+ server = tp_asv_get_string (data->settings, "server");
+
+ if (server != NULL)
+ display_name = g_strdup_printf ("%s on %s",
+ g_value_get_string (username), server);
+ }
+
+ if (display_name == NULL)
+ {
+ display_name = g_strdup_printf ("%s (%s)",
+ data->protocol, g_value_get_string (username));
+ }
DEBUG ("display name: %s\n", display_name);