[empathy] don't update Alias.Nickname if not needed
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] don't update Alias.Nickname if not needed
- Date: Thu, 10 Mar 2011 11:34:45 +0000 (UTC)
commit 1e2ef0f3c681511d1b1e82a51f82b52b9414605f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Mar 10 12:04:37 2011 +0100
don't update Alias.Nickname if not needed
libempathy-gtk/empathy-contact-widget.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index b82ad16..b956e22 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -1228,11 +1228,18 @@ contact_widget_entry_alias_focus_event_cb (GtkEditable *editable,
if (empathy_contact_is_user (information->contact))
{
TpAccount * account;
+ const gchar *current_nickname;
account = empathy_contact_get_account (information->contact);
+ current_nickname = tp_account_get_nickname (account);
- DEBUG ("Set Account.Nickname to %s", alias);
- tp_account_set_nickname_async (account, alias, set_nickname_cb, NULL);
+ if (tp_strdiff (current_nickname, alias))
+ {
+ DEBUG ("Set Account.Nickname to %s", alias);
+
+ tp_account_set_nickname_async (account, alias, set_nickname_cb,
+ NULL);
+ }
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]