]> git.0d.be Git - empathy.git/commitdiff
Merge EmpathyContact:name and *_set_alias() to EmpathyContact:alias
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 7 Jul 2010 15:21:43 +0000 (16:21 +0100)
committerTravis Reitter <treitter@gmail.com>
Wed, 21 Jul 2010 20:25:09 +0000 (13:25 -0700)
The "name" API was a relic of Gossip.

20 files changed:
libempathy-gtk/empathy-chat.c
libempathy-gtk/empathy-contact-dialogs.c
libempathy-gtk/empathy-contact-list-store.c
libempathy-gtk/empathy-contact-list-view.c
libempathy-gtk/empathy-contact-selector-dialog.c
libempathy-gtk/empathy-contact-widget.c
libempathy-gtk/empathy-theme-adium.c
libempathy-gtk/empathy-theme-boxes.c
libempathy-gtk/empathy-theme-irc.c
libempathy-gtk/empathy-ui-utils.c
libempathy/empathy-contact.c
libempathy/empathy-contact.h
libempathy/empathy-individual-manager.c
libempathy/empathy-message.c
libempathy/empathy-tp-chat.c
src/empathy-call-window.c
src/empathy-chat-window.c
src/empathy-event-manager.c
src/empathy-ft-manager.c
src/empathy-map-view.c

index edb1329362acb367070bb476a510047dd6c2eda0..5d8fe71d354b97e6f21a037c0382544d862867ae 100644 (file)
@@ -1119,7 +1119,7 @@ chat_message_received (EmpathyChat *chat, EmpathyMessage *message)
        sender = empathy_message_get_sender (message);
 
        DEBUG ("Appending new message from %s (%d)",
-               empathy_contact_get_name (sender),
+               empathy_contact_get_alias (sender),
                empathy_contact_get_handle (sender));
 
        empathy_chat_view_append_message (chat->view, message);
@@ -1600,7 +1600,7 @@ chat_input_key_press_event_cb (GtkWidget   *widget,
                                 * which might be cased all wrong.
                                 * Fixes #120876
                                 * */
-                               text = empathy_contact_get_name (completed_list->data);
+                               text = empathy_contact_get_alias (completed_list->data);
                        } else {
                                text = completed;
 
@@ -1610,7 +1610,7 @@ chat_input_key_press_event_cb (GtkWidget   *widget,
                                 * */
                                 message = g_string_new ("");
                                 for (l = completed_list; l != NULL; l = l->next) {
-                                       g_string_append (message, empathy_contact_get_name (l->data));
+                                       g_string_append (message, empathy_contact_get_alias (l->data));
                                        g_string_append (message, " - ");
                                 }
                                 empathy_chat_view_append_event (chat->view, message->str);
@@ -2057,7 +2057,7 @@ build_part_message (guint           reason,
        const gchar *actor_name = NULL;
 
        if (actor != NULL) {
-               actor_name = empathy_contact_get_name (actor);
+               actor_name = empathy_contact_get_alias (actor);
        }
 
        /* Having an actor only really makes sense for a few actions... */
@@ -2113,7 +2113,7 @@ chat_members_changed_cb (EmpathyTpChat  *tp_chat,
                         EmpathyChat    *chat)
 {
        EmpathyChatPriv *priv = GET_PRIV (chat);
-       const gchar *name = empathy_contact_get_name (contact);
+       const gchar *name = empathy_contact_get_alias (contact);
        gchar *str;
 
        g_return_if_fail (TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED != reason);
@@ -2148,8 +2148,8 @@ chat_member_renamed_cb (EmpathyTpChat  *tp_chat,
                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_contact_get_alias (old_contact),
+                                      empathy_contact_get_alias (new_contact));
                empathy_chat_view_append_event (chat->view, str);
                g_free (str);
        }
@@ -2817,7 +2817,7 @@ empathy_chat_init (EmpathyChat *chat)
                g_timeout_add_seconds (1, chat_block_events_timeout_cb, chat);
 
        /* Add nick name completion */
-       priv->completion = g_completion_new ((GCompletionFunc) empathy_contact_get_name);
+       priv->completion = g_completion_new ((GCompletionFunc) empathy_contact_get_alias);
        g_completion_set_compare (priv->completion, chat_contacts_completion_func);
 
        chat_create_ui (chat);
@@ -3118,7 +3118,7 @@ empathy_chat_get_name (EmpathyChat *chat)
 
        ret = priv->name;
        if (!ret && priv->remote_contact) {
-               ret = empathy_contact_get_name (priv->remote_contact);
+               ret = empathy_contact_get_alias (priv->remote_contact);
        }
 
        if (!ret)
index b359b86cd737ab91a509c0788fa9a0941db09847..003710b03107ece640a8ce9281038a1b85044769 100644 (file)
@@ -181,7 +181,7 @@ empathy_contact_information_dialog_show (EmpathyContact *contact,
        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
        gtk_window_set_title (GTK_WINDOW (dialog),
-               empathy_contact_get_name (contact));
+               empathy_contact_get_alias (contact));
 
        /* Close button */
        button = gtk_button_new_with_label (GTK_STOCK_CLOSE);
index de838441f8511f90c3d728952cf418669472a963..a7a5beca910c8a67187dcf0e2dd6e23ffa92bf4f 100644 (file)
@@ -982,7 +982,7 @@ add_contact_to_store (GtkTreeStore *store,
                      EmpathyContactListFlags flags)
 {
        gtk_tree_store_insert_with_values (store, iter, parent, 0,
-                           EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_name (contact),
+                           EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_alias (contact),
                            EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, contact,
                            EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, FALSE,
                            EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR, FALSE,
@@ -1009,7 +1009,7 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
 
        priv = GET_PRIV (store);
 
-       if (EMP_STR_EMPTY (empathy_contact_get_name (contact)) ||
+       if (EMP_STR_EMPTY (empathy_contact_get_alias (contact)) ||
            (!priv->show_offline && !empathy_contact_is_online (contact))) {
                return;
        }
@@ -1155,7 +1155,7 @@ contact_list_store_contact_update (EmpathyContactListStore *store,
        if (!in_list && !should_be_in_list) {
                /* Nothing to do. */
                DEBUG ("Contact:'%s' in list:NO, should be:NO",
-                       empathy_contact_get_name (contact));
+                       empathy_contact_get_alias (contact));
 
                g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL);
                g_list_free (iters);
@@ -1163,7 +1163,7 @@ contact_list_store_contact_update (EmpathyContactListStore *store,
        }
        else if (in_list && !should_be_in_list) {
                DEBUG ("Contact:'%s' in list:YES, should be:NO",
-                       empathy_contact_get_name (contact));
+                       empathy_contact_get_alias (contact));
 
                if (priv->show_active) {
                        do_remove = TRUE;
@@ -1179,7 +1179,7 @@ contact_list_store_contact_update (EmpathyContactListStore *store,
        }
        else if (!in_list && should_be_in_list) {
                DEBUG ("Contact:'%s' in list:NO, should be:YES",
-                       empathy_contact_get_name (contact));
+                       empathy_contact_get_alias (contact));
 
                contact_list_store_add_contact (store, contact);
 
@@ -1190,7 +1190,7 @@ contact_list_store_contact_update (EmpathyContactListStore *store,
                }
        } else {
                DEBUG ("Contact:'%s' in list:YES, should be:YES",
-                       empathy_contact_get_name (contact));
+                       empathy_contact_get_alias (contact));
 
                /* Get online state before. */
                if (iters && g_list_length (iters) > 0) {
@@ -1230,7 +1230,7 @@ contact_list_store_contact_update (EmpathyContactListStore *store,
                                    EMPATHY_CONTACT_LIST_STORE_COL_ICON_STATUS, pixbuf_status,
                                    EMPATHY_CONTACT_LIST_STORE_COL_PIXBUF_AVATAR, pixbuf_avatar,
                                    EMPATHY_CONTACT_LIST_STORE_COL_PIXBUF_AVATAR_VISIBLE, show_avatar,
-                                   EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_name (contact),
+                                   EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_alias (contact),
                                    EMPATHY_CONTACT_LIST_STORE_COL_PRESENCE_TYPE,
                                      empathy_contact_get_presence (contact),
                                    EMPATHY_CONTACT_LIST_STORE_COL_STATUS,
@@ -1278,7 +1278,7 @@ contact_list_store_contact_updated_cb (EmpathyContact          *contact,
                                       EmpathyContactListStore *store)
 {
        DEBUG ("Contact:'%s' updated, checking roster is in sync...",
-               empathy_contact_get_name (contact));
+               empathy_contact_get_alias (contact));
 
        contact_list_store_contact_update (store, contact);
 }
@@ -1326,7 +1326,7 @@ contact_list_store_contact_active_new (EmpathyContactListStore *store,
        ShowActiveData *data;
 
        DEBUG ("Contact:'%s' now active, and %s be removed",
-               empathy_contact_get_name (contact),
+               empathy_contact_get_alias (contact),
                remove_ ? "WILL" : "WILL NOT");
 
        data = g_slice_new0 (ShowActiveData);
@@ -1358,12 +1358,12 @@ contact_list_store_contact_active_cb (ShowActiveData *data)
            !priv->show_offline &&
            !empathy_contact_is_online (data->contact)) {
                DEBUG ("Contact:'%s' active timeout, removing item",
-                       empathy_contact_get_name (data->contact));
+                       empathy_contact_get_alias (data->contact));
                contact_list_store_remove_contact (data->store, data->contact);
        }
 
        DEBUG ("Contact:'%s' no longer active",
-               empathy_contact_get_name (data->contact));
+               empathy_contact_get_alias (data->contact));
 
        contact_list_store_contact_set_active (data->store,
                                               data->contact,
@@ -1574,8 +1574,8 @@ contact_list_store_contact_sort (EmpathyContact *contact_a,
        g_return_val_if_fail (contact_a != NULL || contact_b != NULL, 0);
 
        /* alias */
-       ret_val = g_utf8_collate (empathy_contact_get_name (contact_a),
-                                 empathy_contact_get_name (contact_b));
+       ret_val = g_utf8_collate (empathy_contact_get_alias (contact_a),
+                                 empathy_contact_get_alias (contact_b));
 
        if (ret_val != 0)
                goto out;
index 0e7c227d94e75762eed85ed0f8f35c74d875daf1..5860adef8e340aa33ab4b9d3f83ca8998a79e77d 100644 (file)
@@ -152,7 +152,7 @@ contact_list_view_is_visible_contact (EmpathyContactListView *self,
        g_assert (live != NULL);
 
        /* check alias name */
-       str = empathy_contact_get_name (contact);
+       str = empathy_contact_get_alias (contact);
        if (empathy_live_search_match (live, str))
                return TRUE;
 
@@ -2063,7 +2063,7 @@ contact_list_view_remove_activate_cb (GtkMenuItem            *menuitem,
 
                parent = empathy_get_toplevel_window (GTK_WIDGET (view));
                text = g_strdup_printf (_("Do you really want to remove the contact '%s'?"),
-                                       empathy_contact_get_name (contact));
+                                       empathy_contact_get_alias (contact));
                if (contact_list_view_remove_dialog_show (parent, _("Removing contact"), text)) {
                        EmpathyContactList *list;
 
index c09b25cefb9d196b148e3f05f1cbf6f62f579670..b04e56daa678cf9a42a343757889d8ff20ff064e 100644 (file)
@@ -135,16 +135,16 @@ contact_selector_dialog_account_changed_cb (GtkWidget *widget,
 
       DEBUG ("Adding contact ID %s, Name %s",
              empathy_contact_get_id (contact),
-             empathy_contact_get_name (contact));
+             empathy_contact_get_alias (contact));
 
       tmpstr = g_strdup_printf ("%s (%s)",
-        empathy_contact_get_name (contact),
+        empathy_contact_get_alias (contact),
         empathy_contact_get_id (contact));
 
       gtk_list_store_insert_with_values (priv->store, &iter, -1,
         COMPLETION_COL_TEXT, tmpstr,
         COMPLETION_COL_ID, empathy_contact_get_id (contact),
-        COMPLETION_COL_NAME, empathy_contact_get_name (contact),
+        COMPLETION_COL_NAME, empathy_contact_get_alias (contact),
         -1);
 
       g_free (tmpstr);
index 0da9e0091379aa5fdc941a9b6daac3521acc50b6..77d22c9155e64f3d5ea8f061e9d0cd38591ccd9f 100644 (file)
@@ -1086,7 +1086,7 @@ contact_widget_location_update (EmpathyContactWidget *information)
       champlain_view_add_layer (information->map_view, layer);
 
       marker = champlain_marker_new_with_text (
-          empathy_contact_get_name (information->contact), NULL, NULL, NULL);
+          empathy_contact_get_alias (information->contact), NULL, NULL, NULL);
       champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), lat, lon);
       clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
 
@@ -1378,10 +1378,10 @@ contact_widget_name_notify_cb (EmpathyContactWidget *information)
 {
   if (GTK_IS_ENTRY (information->widget_alias))
       gtk_entry_set_text (GTK_ENTRY (information->widget_alias),
-          empathy_contact_get_name (information->contact));
+          empathy_contact_get_alias (information->contact));
   else
       gtk_label_set_label (GTK_LABEL (information->widget_alias),
-          empathy_contact_get_name (information->contact));
+          empathy_contact_get_alias (information->contact));
 }
 
 static void
index c2267f767481761bdb8d056a89519dc4d5706381..53c78c18a3dad2700cfc6e97275e04dc4b5a9faa 100644 (file)
@@ -461,7 +461,7 @@ theme_adium_append_message (EmpathyChatView *view,
        timestamp = empathy_message_get_timestamp (msg);
        body = empathy_message_get_body (msg);
        body_escaped = theme_adium_parse_body (body);
-       name = empathy_contact_get_name (sender);
+       name = empathy_contact_get_alias (sender);
        contact_id = empathy_contact_get_id (sender);
 
        /* If this is a /me, append an event */
index 531f2baa6a109a5d7f76dc875a7721d66ea21356..24b7fc5b4a47c6babd4f58c8c59cff42a30d2d24 100644 (file)
@@ -204,7 +204,7 @@ theme_boxes_maybe_append_header (EmpathyThemeBoxes *theme,
        gboolean              consecutive;
 
        contact = empathy_message_get_sender (msg);
-       name = empathy_contact_get_name (contact);
+       name = empathy_contact_get_alias (contact);
        last_contact = empathy_chat_text_view_get_last_contact (view);
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (theme));
        time_ = empathy_message_get_timestamp (msg);
@@ -347,7 +347,7 @@ theme_boxes_append_message (EmpathyChatTextView *view,
                gchar *body;
 
                body = g_strdup_printf (" * %s %s",
-                                       empathy_contact_get_name (sender),
+                                       empathy_contact_get_alias (sender),
                                        empathy_message_get_body (message));
                empathy_chat_text_view_append_body (EMPATHY_CHAT_TEXT_VIEW (view),
                                                    body,
index 5d298564e4c686d15ee2e3b94eb2f2eedb9936ae..afd59523e125f043df7c5d007ff90d11f22f2d24 100644 (file)
@@ -62,11 +62,11 @@ theme_irc_append_message (EmpathyChatTextView *view,
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
 
        contact = empathy_message_get_sender (message);
-       name = empathy_contact_get_name (contact);
+       name = empathy_contact_get_alias (contact);
 
        if (empathy_message_get_tptype (message) == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION) {
                tmp = g_strdup_printf (" * %s %s",
-                                      empathy_contact_get_name (contact),
+                                      empathy_contact_get_alias (contact),
                                       empathy_message_get_body (message));
                empathy_chat_text_view_append_body (view, tmp,
                                                    EMPATHY_CHAT_TEXT_VIEW_TAG_ACTION);
index b10b42a443c7c35d3c401cfd8e5f73615d0ee79b..9fcdc985eb6a75635aa6d53774c5d1ad75a0e05c 100644 (file)
@@ -1858,7 +1858,7 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
        g_assert (contact != NULL);
 
        title = g_strdup_printf (_("Incoming file from %s"),
-               empathy_contact_get_name (contact));
+               empathy_contact_get_alias (contact));
 
        widget = gtk_file_chooser_dialog_new (title,
                                              NULL,
index 3a16c3e3773fbacfcdd207a26b8e96ec93acdf2d..57a4449c396a39286295192d42cdb2bf70f2e424 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
   TpAccount *account;
   FolksPersona *persona;
   gchar *id;
-  gchar *name;
+  gchar *alias;
   EmpathyAvatar *avatar;
   TpConnectionPresenceType presence;
   gchar *presence_message;
@@ -96,7 +96,7 @@ enum
   PROP_ACCOUNT,
   PROP_PERSONA,
   PROP_ID,
-  PROP_NAME,
+  PROP_ALIAS,
   PROP_AVATAR,
   PROP_PRESENCE,
   PROP_PRESENCE_MESSAGE,
@@ -125,7 +125,7 @@ tp_contact_notify_cb (TpContact *tp_contact,
 
   /* Forward property notifications */
   if (!tp_strdiff (param->name, "alias"))
-    g_object_notify (contact, "name");
+    g_object_notify (contact, "alias");
   else if (!tp_strdiff (param->name, "presence-type")) {
     TpConnectionPresenceType presence;
 
@@ -242,10 +242,10 @@ empathy_contact_class_init (EmpathyContactClass *class)
         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (object_class,
-      PROP_NAME,
-      g_param_spec_string ("name",
-        "Contact Name",
-        "The name of the contact",
+      PROP_ALIAS,
+      g_param_spec_string ("alias",
+        "Contact alias",
+        "An alias for the contact",
         NULL,
         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
@@ -345,7 +345,7 @@ contact_finalize (GObject *object)
 
   DEBUG ("finalize: %p", object);
 
-  g_free (priv->name);
+  g_free (priv->alias);
   g_free (priv->id);
   g_free (priv->presence_message);
 
@@ -411,8 +411,8 @@ contact_get_property (GObject *object,
       case PROP_ID:
         g_value_set_string (value, empathy_contact_get_id (contact));
         break;
-      case PROP_NAME:
-        g_value_set_string (value, empathy_contact_get_name (contact));
+      case PROP_ALIAS:
+        g_value_set_string (value, empathy_contact_get_alias (contact));
         break;
       case PROP_AVATAR:
         g_value_set_boxed (value, empathy_contact_get_avatar (contact));
@@ -462,8 +462,8 @@ contact_set_property (GObject *object,
       case PROP_ID:
         empathy_contact_set_id (contact, g_value_get_string (value));
         break;
-      case PROP_NAME:
-        empathy_contact_set_name (contact, g_value_get_string (value));
+      case PROP_ALIAS:
+        empathy_contact_set_alias (contact, g_value_get_string (value));
         break;
       case PROP_AVATAR:
         empathy_contact_set_avatar (contact, g_value_get_boxed (value));
@@ -512,7 +512,7 @@ empathy_contact_from_tpl_contact (TpAccount *account,
 
   retval = g_object_new (EMPATHY_TYPE_CONTACT,
       "id", tpl_entity_get_alias (tpl_entity),
-      "name", tpl_entity_get_identifier (tpl_entity),
+      "alias", tpl_entity_get_identifier (tpl_entity),
       "account", account,
       "is-user", is_user,
       NULL);
@@ -527,7 +527,7 @@ empathy_contact_from_tpl_contact (TpAccount *account,
 EmpathyContact *
 empathy_contact_new_for_log (TpAccount *account,
                              const gchar *id,
-                             const gchar *name,
+                             const gchar *alias,
                              gboolean is_user)
 {
   g_return_val_if_fail (id != NULL, NULL);
@@ -536,7 +536,7 @@ empathy_contact_new_for_log (TpAccount *account,
   return g_object_new (EMPATHY_TYPE_CONTACT,
       "account", account,
       "id", id,
-      "name", name,
+      "alias", alias,
       "is-user", is_user,
       NULL);
 }
@@ -588,15 +588,15 @@ empathy_contact_set_id (EmpathyContact *contact,
       priv->id = g_strdup (id);
 
       g_object_notify (G_OBJECT (contact), "id");
-      if (EMP_STR_EMPTY (priv->name))
-          g_object_notify (G_OBJECT (contact), "name");
+      if (EMP_STR_EMPTY (priv->alias))
+          g_object_notify (G_OBJECT (contact), "alias");
     }
 
   g_object_unref (contact);
 }
 
 const gchar *
-empathy_contact_get_name (EmpathyContact *contact)
+empathy_contact_get_alias (EmpathyContact *contact)
 {
   EmpathyContactPriv *priv;
   const gchar        *alias;
@@ -608,7 +608,7 @@ empathy_contact_get_name (EmpathyContact *contact)
   if (priv->tp_contact != NULL)
     alias = tp_contact_get_alias (priv->tp_contact);
   else
-    alias = priv->name;
+    alias = priv->alias;
 
   if (!EMP_STR_EMPTY (alias))
     return alias;
@@ -617,41 +617,26 @@ empathy_contact_get_name (EmpathyContact *contact)
 }
 
 void
-empathy_contact_set_name (EmpathyContact *contact,
-                          const gchar *name)
+empathy_contact_set_alias (EmpathyContact *contact,
+                          const gchar *alias)
 {
   EmpathyContactPriv *priv;
+  FolksPersona *persona;
 
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
   priv = GET_PRIV (contact);
 
   g_object_ref (contact);
-  if (tp_strdiff (name, priv->name))
+
+  if (tp_strdiff (alias, priv->alias))
     {
-      g_free (priv->name);
-      priv->name = g_strdup (name);
-      g_object_notify (G_OBJECT (contact), "name");
+      g_free (priv->alias);
+      priv->alias = g_strdup (alias);
+      g_object_notify (G_OBJECT (contact), "alias");
     }
-  g_object_unref (contact);
-}
-
-void
-empathy_contact_set_alias (EmpathyContact *contact,
-    const gchar *alias)
-{
-  FolksPersona *persona;
-
-  g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
-  persona = empathy_contact_get_persona (contact);
-  if (persona == NULL || !FOLKS_IS_ALIAS (persona))
-    return;
-
-  DEBUG ("Setting alias for contact %s to %s", empathy_contact_get_id (contact),
-      alias);
-
-  folks_alias_set_alias (FOLKS_ALIAS (persona), alias);
+  g_object_unref (contact);
 }
 
 EmpathyAvatar *
index a5b58ce6496ccdb93827ce50832b21202274d84c..7980ab252c7af06396f1f5c2232d53c89b2d58a6 100644 (file)
@@ -75,12 +75,11 @@ EmpathyContact * empathy_contact_new (TpContact *tp_contact);
 EmpathyContact * empathy_contact_from_tpl_contact (TpAccount *account,
     TplEntity *tpl_contact);
 EmpathyContact * empathy_contact_new_for_log (TpAccount *account,
-    const gchar *id, const gchar *name, gboolean is_user);
+    const gchar *id, const gchar *alias, gboolean is_user);
 TpContact * empathy_contact_get_tp_contact (EmpathyContact *contact);
 const gchar * empathy_contact_get_id (EmpathyContact *contact);
 void empathy_contact_set_id (EmpathyContact *contact, const gchar *id);
-const gchar * empathy_contact_get_name (EmpathyContact *contact);
-void empathy_contact_set_name (EmpathyContact *contact, const gchar *name);
+const gchar * empathy_contact_get_alias (EmpathyContact *contact);
 void empathy_contact_set_alias (EmpathyContact *contact, const gchar *alias);
 EmpathyAvatar * empathy_contact_get_avatar (EmpathyContact *contact);
 void empathy_contact_set_avatar (EmpathyContact *contact,
index 9eeb5d3c801e357c2974fb983d4175aaa26ad08c..cb3a3975ecda0bbc86c8f4ebdabd49333b29f133 100644 (file)
@@ -309,7 +309,7 @@ empathy_individual_manager_add_from_contact (EmpathyIndividualManager *self,
   g_object_ref (contact);
 
   DEBUG ("adding individual from contact %s (%s)",
-      empathy_contact_get_id (contact), empathy_contact_get_name (contact));
+      empathy_contact_get_id (contact), empathy_contact_get_alias (contact));
 
   account = empathy_contact_get_account (contact);
   store_id = tp_proxy_get_object_path (TP_PROXY (account));
index a8d6af57578d339a43cb50e1f9335a305f07d45a..07827f8e077b3496b5f365b9d609786e3f32e950 100644 (file)
@@ -530,7 +530,7 @@ empathy_message_should_highlight (EmpathyMessage *message)
                return FALSE;
        }
 
-       to = empathy_contact_get_name (contact);
+       to = empathy_contact_get_alias (contact);
        if (!to) {
                return FALSE;
        }
index 90c31e4cc25afdae3ca6373f8d1b4d2e95025c67..0ec866617418e2c4b6fe90c47fe0bc6404cb8142 100644 (file)
@@ -429,7 +429,7 @@ tp_chat_state_changed_got_contact_cb (TpConnection            *connection,
 
        state = GPOINTER_TO_UINT (user_data);
        DEBUG ("Chat state changed for %s (%d): %d",
-               empathy_contact_get_name (contact),
+               empathy_contact_get_alias (contact),
                empathy_contact_get_handle (contact), state);
 
        g_signal_emit (chat, signals[CHAT_STATE_CHANGED], 0, contact, state);
index e607b2ef7535de92dac01013f27d20fa6760460e..ffdcb5c719dec19a8e99515705a7ab14d33e0085 100644 (file)
@@ -1244,7 +1244,7 @@ set_window_title (EmpathyCallWindow *self)
   /* translators: Call is a noun and %s is the contact name. This string
    * is used in the window title */
   tmp = g_strdup_printf (_("Call with %s"),
-      empathy_contact_get_name (priv->contact));
+      empathy_contact_get_alias (priv->contact));
   gtk_window_set_title (GTK_WINDOW (self), tmp);
   g_free (tmp);
 }
@@ -2215,19 +2215,19 @@ media_stream_error_to_txt (EmpathyCallWindow *self,
           return g_strdup_printf (
               _("%s's software does not understand any of the audio formats "
                 "supported by your computer"),
-            empathy_contact_get_name (priv->contact));
+            empathy_contact_get_alias (priv->contact));
         else
           return g_strdup_printf (
               _("%s's software does not understand any of the video formats "
                 "supported by your computer"),
-            empathy_contact_get_name (priv->contact));
+            empathy_contact_get_alias (priv->contact));
 
       case TP_MEDIA_STREAM_ERROR_CONNECTION_FAILED:
         return g_strdup_printf (
             _("Can't establish a connection to %s. "
               "One of you might be on a network that does not allow "
               "direct connections."),
-          empathy_contact_get_name (priv->contact));
+          empathy_contact_get_alias (priv->contact));
 
       case TP_MEDIA_STREAM_ERROR_NETWORK_ERROR:
           return g_strdup (_("There was a failure on the network"));
index c4ce8b26ede8255b78c74614fe4463aa9abc176c..8c2eed6b14a7a558a8fecec8c75399f0c1699419 100644 (file)
@@ -1281,7 +1281,7 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
        }
 
        sender = empathy_message_get_sender (message);
-       header = empathy_contact_get_name (sender);
+       header = empathy_contact_get_alias (sender);
        body = empathy_message_get_body (message);
        escaped = g_markup_escape_text (body, -1);
        has_x_canonical_append = empathy_notify_manager_has_capability (
index bf3a48a8a9e6737731506a33713331ca196caa58..3f4281fbf43391802058021ce2e8a47c61eae87a 100644 (file)
@@ -476,10 +476,10 @@ event_channel_process_voip_func (EventPriv *event)
     GTK_MESSAGE_DIALOG (dialog), video ?
       _("%s is video calling you. Do you want to answer?"):
       _("%s is calling you. Do you want to answer?"),
-      empathy_contact_get_name (event->approval->contact));
+      empathy_contact_get_alias (event->approval->contact));
 
   title = g_strdup_printf (_("Incoming call from %s"),
-      empathy_contact_get_name (event->approval->contact));
+      empathy_contact_get_alias (event->approval->contact));
 
   gtk_window_set_title (GTK_WINDOW (dialog), title);
   g_free (title);
@@ -540,7 +540,7 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat,
   event = event_lookup_by_approval (approval->manager, approval);
 
   sender = empathy_message_get_sender (message);
-  header = empathy_contact_get_name (sender);
+  header = empathy_contact_get_alias (sender);
   msg = empathy_message_get_body (message);
 
   channel = empathy_tp_chat_get_channel (tp_chat);
@@ -621,7 +621,7 @@ event_manager_media_channel_got_contact (EventManagerApproval *approval)
 
   header = g_strdup_printf (
     video ? _("Incoming video call from %s") :_("Incoming call from %s"),
-    empathy_contact_get_name (approval->contact));
+    empathy_contact_get_alias (approval->contact));
 
   event_manager_add (approval->manager, approval->contact,
       EMPATHY_EVENT_TYPE_VOIP,
@@ -707,7 +707,7 @@ event_room_channel_process_func (EventPriv *event)
 
   gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
       _("%s is inviting you to join %s"),
-      empathy_contact_get_name (event->approval->contact),
+      empathy_contact_get_alias (event->approval->contact),
       tp_channel_get_identifier (channel));
 
   gtk_dialog_set_default_response (GTK_DIALOG (dialog),
@@ -758,7 +758,7 @@ event_manager_muc_invite_got_contact_cb (TpConnection *connection,
       NULL, NULL, &invite_msg);
 
   msg = g_strdup_printf (_("%s invited you to join %s"),
-      empathy_contact_get_name (approval->contact),
+      empathy_contact_get_alias (approval->contact),
       tp_channel_get_identifier (approval->main_channel));
 
   event_manager_add (approval->manager, approval->contact,
@@ -785,7 +785,7 @@ event_manager_ft_got_contact_cb (TpConnection *connection,
   approval->contact = g_object_ref (contact);
 
   header = g_strdup_printf (_("Incoming file transfer from %s"),
-                            empathy_contact_get_name (approval->contact));
+                            empathy_contact_get_alias (approval->contact));
 
   event_manager_add (approval->manager, approval->contact,
       EMPATHY_EVENT_TYPE_TRANSFER, EMPATHY_IMAGE_DOCUMENT_SEND, header, NULL,
@@ -986,7 +986,7 @@ event_manager_pendings_changed_cb (EmpathyContactList  *list,
     }
 
   header = g_strdup_printf (_("Subscription requested by %s"),
-    empathy_contact_get_name (contact));
+    empathy_contact_get_alias (contact));
 
   if (!EMP_STR_EMPTY (message))
     event_msg = g_strdup_printf (_("\nMessage: %s"), message);
@@ -1033,7 +1033,7 @@ event_manager_presence_changed_cb (EmpathyContact *contact,
                 EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNOUT))
             {
               header = g_strdup_printf (_("%s is now offline."),
-                  empathy_contact_get_name (contact));
+                  empathy_contact_get_alias (contact));
 
               event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE,
                   EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL);
@@ -1053,7 +1053,7 @@ event_manager_presence_changed_cb (EmpathyContact *contact,
                 EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNIN))
             {
               header = g_strdup_printf (_("%s is now online."),
-                  empathy_contact_get_name (contact));
+                  empathy_contact_get_alias (contact));
 
               event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE,
                   EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL);
index 34ac1adac583a8f1dfc7a102c4eb187cb61dc8c0..58edc584e6e8aafd3444c26092a9d0ef88b03fec 100644 (file)
@@ -205,7 +205,7 @@ ft_manager_remove_file_from_model (EmpathyFTManager *manager,
   g_return_if_fail (row_ref);
 
   DEBUG ("Removing file transfer from window: contact=%s, filename=%s",
-      empathy_contact_get_name (empathy_ft_handler_get_contact (handler)),
+      empathy_contact_get_alias (empathy_ft_handler_get_contact (handler)),
       empathy_ft_handler_get_filename (handler));
 
   /* Get the iter from the row_ref */
@@ -296,7 +296,7 @@ ft_manager_format_contact_info (EmpathyFTHandler *handler)
   char *retval;
 
   incoming = empathy_ft_handler_is_incoming (handler);
-  contact_name = empathy_contact_get_name
+  contact_name = empathy_contact_get_alias
     (empathy_ft_handler_get_contact (handler));
   filename = empathy_ft_handler_get_filename (handler);
 
@@ -326,7 +326,7 @@ ft_manager_format_error_message (EmpathyFTHandler *handler,
 
   contact = empathy_ft_handler_get_contact (handler);
   if (contact)
-    contact_name = empathy_contact_get_name (contact);
+    contact_name = empathy_contact_get_alias (contact);
 
   filename = empathy_ft_handler_get_filename (handler);
 
@@ -478,7 +478,7 @@ do_real_transfer_done (EmpathyFTManager *manager,
   g_return_if_fail (row_ref != NULL);
 
   incoming = empathy_ft_handler_is_incoming (handler);
-  contact_name = empathy_contact_get_name
+  contact_name = empathy_contact_get_alias
     (empathy_ft_handler_get_contact (handler));
   filename = empathy_ft_handler_get_filename (handler);
 
@@ -857,7 +857,7 @@ ft_manager_stop (EmpathyFTManager *manager)
   g_return_if_fail (handler != NULL);
 
   DEBUG ("Stopping file transfer: contact=%s, filename=%s",
-      empathy_contact_get_name (empathy_ft_handler_get_contact (handler)),
+      empathy_contact_get_alias (empathy_ft_handler_get_contact (handler)),
       empathy_ft_handler_get_filename (handler));
 
   empathy_ft_handler_cancel_transfer (handler);
index 2b0b93f7f67ee5c06362d87e2cf5666d2a411299..2143f19ef82241e370f89642c6a2913f5688e18e 100644 (file)
@@ -227,7 +227,7 @@ map_view_contacts_update_label (ChamplainMarker *marker)
 
   contact = g_object_get_data (G_OBJECT (marker), "contact");
   location = empathy_contact_get_location (contact);
-  name = empathy_contact_get_name (contact);
+  name = empathy_contact_get_alias (contact);
   gtime = g_hash_table_lookup (location, EMPATHY_LOCATION_TIMESTAMP);
 
   if (gtime != NULL)