[empathy] import-widget: use the server in IRC account display name
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] import-widget: use the server in IRC account display name
- Date: Fri, 16 Dec 2011 11:56:08 +0000 (UTC)
commit 7d22de0340197c4578e4a7e1dd4c4d2e642ba689
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Dec 16 12:52:44 2011 +0100
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
src/empathy-import-widget.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-import-widget.c b/src/empathy-import-widget.c
index 9a8917f..aaf20d5 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]