Mercurial > pidgin.yaz
diff src/blist.c @ 12319:7630a95f3b8b
[gaim-migrate @ 14623]
Improve Handling of Aliasing with respect to Contacts
Basically, if you choose "Alias", your changes will be saved to whichever text field you saw. This makes sense, given we're doing inline editing. Also, because we're doing inline editing, I think it's weird to have Alias offered in a buddy submenu (as choosing it causes the text to change pre-edit and post-edit, making you feel like your changes weren't saved). I've removed it. If you need to alias a buddy that's not currently online, you can always expand the contact.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 04 Dec 2005 17:54:43 +0000 |
parents | 1504d878be54 |
children | bd42f4d5854c |
line wrap: on
line diff
--- a/src/blist.c Sun Dec 04 17:47:37 2005 +0000 +++ b/src/blist.c Sun Dec 04 17:54:43 2005 +0000 @@ -832,6 +832,40 @@ ops->update(gaimbuddylist, (GaimBlistNode *)buddy); } +void gaim_blist_alias_contact(GaimContact *contact, const char *alias) +{ + GaimBlistUiOps *ops = gaimbuddylist->ui_ops; + GaimConversation *conv; + char *old_alias = contact->alias; + GaimBlistNode *bnode; + + g_return_if_fail(contact != NULL); + + if ((alias != NULL) && (*alias != '\0')) + contact->alias = g_strdup(alias); + else + contact->alias = NULL; + + gaim_blist_schedule_save(); + + if (ops && ops->update) + ops->update(gaimbuddylist, (GaimBlistNode *)contact); + + for(bnode = ((GaimBlistNode *)contact)->child; bnode != NULL; bnode = bnode->next) + { + GaimBuddy *buddy = (GaimBuddy *)bnode; + + conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, + buddy->account); + if (conv) + gaim_conversation_autoset_title(conv); + } + + gaim_signal_emit(gaim_blist_get_handle(), "blist-node-aliased", + contact, old_alias); + g_free(old_alias); +} + void gaim_blist_alias_chat(GaimChat *chat, const char *alias) { GaimBlistUiOps *ops = gaimbuddylist->ui_ops;