Mercurial > pidgin.yaz
diff src/protocols/oscar/oscar.c @ 7172:895cd1d03efb
[gaim-migrate @ 7740]
I added buddy comment support for AIM and ICQ
I also fixed a tini memleak in gaim_request_something when
using a multiline dialog.
I also tried to organize ChangeLog some. I put stuff that
I thought normal people would care about the most at the top,
and tried to group stuff aimed at plugin authors together, and
nearer to the bottom. Feel free to do a better job than me.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 06 Oct 2003 03:21:33 +0000 |
parents | e6b01bd8d6cd |
children | 7c43dbbb198c |
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c Mon Oct 06 02:28:43 2003 +0000 +++ b/src/protocols/oscar/oscar.c Mon Oct 06 03:21:33 2003 +0000 @@ -6071,11 +6071,65 @@ return m; } +static void oscar_ssi_editcomment(struct name_data *data, const char *text) { + struct oscar_data *od = data->gc->proto_data; + GaimBuddy *b; + GaimGroup *g; + + if (!(b = gaim_find_buddy(gaim_connection_get_account(data->gc), data->name))) { + oscar_free_name_data(data); + return; + } + + if (!(g = gaim_find_buddys_group(b))) { + oscar_free_name_data(data); + return; + } + + aim_ssi_editcomment(od->sess, g->name, data->name, text); + oscar_free_name_data(data); +} + +static void oscar_buddycb_edit_comment(GaimConnection *gc, const char *name) { + struct oscar_data *od = gc->proto_data; + struct name_data *data = g_new(struct name_data, 1); + GaimBuddy *b; + GaimGroup *g; + char *comment; + gchar *comment_utf8; + + if (!(b = gaim_find_buddy(gaim_connection_get_account(gc), name))) + return; + if (!(g = gaim_find_buddys_group(b))) + return; + comment = aim_ssi_getcomment(od->sess->ssi.local, g->name, name); + comment_utf8 = comment ? gaim_utf8_try_convert(comment) : NULL; + + data->gc = gc; + data->name = g_strdup(name); + data->nick = NULL; + + gaim_request_input(gc, NULL, _("Buddy Comment:"), NULL, + comment_utf8, TRUE, FALSE, + _("OK"), G_CALLBACK(oscar_ssi_editcomment), + _("Cancel"), G_CALLBACK(oscar_free_name_data), + data); + + free(comment); + g_free(comment_utf8); +} + static GList *oscar_buddy_menu(GaimConnection *gc, const char *who) { struct oscar_data *od = gc->proto_data; GList *m = NULL; struct proto_buddy_menu *pbm; + pbm = g_new0(struct proto_buddy_menu, 1); + pbm->label = _("Edit Buddy Comment"); + pbm->callback = oscar_buddycb_edit_comment; + pbm->gc = gc; + m = g_list_append(m, pbm); + if (od->icq) { #if 0 pbm = g_new0(struct proto_buddy_menu, 1);