The "name" API was a relic of Gossip.
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);
* 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;
* */
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);
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... */
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);
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);
}
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);
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)
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);
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,
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;
}
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);
}
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;
}
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);
}
} 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) {
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,
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);
}
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);
!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,
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;
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;
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;
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);
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);
{
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
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 */
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);
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,
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);
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,
TpAccount *account;
FolksPersona *persona;
gchar *id;
- gchar *name;
+ gchar *alias;
EmpathyAvatar *avatar;
TpConnectionPresenceType presence;
gchar *presence_message;
PROP_ACCOUNT,
PROP_PERSONA,
PROP_ID,
- PROP_NAME,
+ PROP_ALIAS,
PROP_AVATAR,
PROP_PRESENCE,
PROP_PRESENCE_MESSAGE,
/* 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;
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));
DEBUG ("finalize: %p", object);
- g_free (priv->name);
+ g_free (priv->alias);
g_free (priv->id);
g_free (priv->presence_message);
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));
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));
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);
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);
return g_object_new (EMPATHY_TYPE_CONTACT,
"account", account,
"id", id,
- "name", name,
+ "alias", alias,
"is-user", is_user,
NULL);
}
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;
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;
}
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 *
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,
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));
return FALSE;
}
- to = empathy_contact_get_name (contact);
+ to = empathy_contact_get_alias (contact);
if (!to) {
return FALSE;
}
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);
/* 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);
}
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"));
}
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 (
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);
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);
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,
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),
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,
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,
}
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);
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);
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);
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 */
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);
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);
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);
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);
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)