You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rob F. <rob...@us...> - 2001-10-18 00:24:11
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv10431 Modified Files: dialogs.c Log Message: You can now specify which protocol to add buddies to. Index: dialogs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/dialogs.c,v retrieving revision 1.258 retrieving revision 1.259 diff -u -d -r1.258 -r1.259 --- dialogs.c 2001/10/12 21:12:56 1.258 +++ dialogs.c 2001/10/18 00:24:08 1.259 @@ -115,6 +115,7 @@ GtkWidget *combo; GtkWidget *entry; GtkWidget *entry_for_alias; + GtkWidget *account; struct gaim_connection *gc; }; @@ -810,6 +811,59 @@ gtk_widget_show(a->window); } +static void addbuddy_select_account(GtkObject *w, struct gaim_connection *gc) +{ + struct addbuddy *b = gtk_object_get_user_data(w); + + b->gc = gc; +} + +static void create_online_user_names(struct addbuddy *b) +{ + char buf[2048]; /* Never hurts to be safe ;-) */ + GSList *g = connections; + struct gaim_connection *c; + GtkWidget *menu, *opt; + int count = 0; + int place = 0; + + menu = gtk_menu_new(); + + while (g) { + c = (struct gaim_connection *)g->data; + g_snprintf(buf, sizeof(buf), "%s (%s)", + c->username, (*c->prpl->name)()); + opt = gtk_menu_item_new_with_label(buf); + gtk_object_set_user_data(GTK_OBJECT(opt), b); + gtk_signal_connect(GTK_OBJECT(opt), "activate", + GTK_SIGNAL_FUNC(addbuddy_select_account), + c); + gtk_widget_show(opt); + gtk_menu_append(GTK_MENU(menu), opt); + + /* Now check to see if it's our current menu */ + if (c == b->gc) { + place = count; + gtk_menu_item_activate(GTK_MENU_ITEM(opt)); + gtk_option_menu_set_history(GTK_OPTION_MENU(b->account), count); + + /* Do the cha cha cha */ + } + + count++; + + g = g->next; + } + + gtk_option_menu_remove_menu(GTK_OPTION_MENU(b->account)); + gtk_option_menu_set_menu(GTK_OPTION_MENU(b->account), menu); + gtk_option_menu_set_history(GTK_OPTION_MENU(b->account), place); + + gtk_widget_show(b->account); + gtk_widget_show(b->account->parent); + +} + void show_add_buddy(struct gaim_connection *gc, char *buddy, char *group) { GtkWidget *mainbox; @@ -819,6 +873,7 @@ GtkWidget *cancel; GtkWidget *add; GtkWidget *label; + GList *tmp; struct addbuddy *a = g_new0(struct addbuddy, 1); a->gc = gc; @@ -842,7 +897,7 @@ gtk_box_pack_start(GTK_BOX(mainbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); - table = gtk_table_new(3, 2, FALSE); + table = gtk_table_new(3, 3, FALSE); gtk_table_set_row_spacings(GTK_TABLE(table), 5); gtk_table_set_col_spacings(GTK_TABLE(table), 5); gtk_container_set_border_width(GTK_CONTAINER(table), 5); @@ -872,6 +927,17 @@ if (group != NULL) gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group); gtk_table_attach_defaults(GTK_TABLE(table), a->combo, 1, 2, 2, 3); + + /* Set up stuff for the account box */ + label = gtk_label_new(_("Add To")); + gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4); + + a->account = gtk_option_menu_new(); + gtk_table_attach_defaults(GTK_TABLE(table), a->account, 1, 2, 3, 4); + + create_online_user_names(a); + + /* End of account box */ bbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(mainbox), bbox, TRUE, TRUE, 0); |
From: Eric W. <war...@us...> - 2001-10-17 20:24:14
|
Update of /cvsroot/gaim/gaim/src/protocols/toc In directory usw-pr-cvs1:/tmp/cvs-serv10219/protocols/toc Modified Files: toc.c Log Message: hi Index: toc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/toc/toc.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- toc.c 2001/10/16 23:24:35 1.27 +++ toc.c 2001/10/17 20:24:11 1.28 @@ -596,7 +596,7 @@ } } else if (!strcasecmp(c, "CONFIG")) { c = strtok(NULL, ":"); - parse_toc_buddy_list(gc, c, 0); + parse_toc_buddy_list(gc, c); } else if (!strcasecmp(c, "NICK")) { /* ignore NICK so that things get imported/exported properly c = strtok(NULL, ":"); |
From: Eric W. <war...@us...> - 2001-10-17 20:24:14
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv10219 Modified Files: core.h list.c Log Message: hi Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- core.h 2001/10/15 19:52:44 1.9 +++ core.h 2001/10/17 20:24:11 1.10 @@ -149,7 +149,7 @@ extern void do_import(struct gaim_connection *, char *); extern int bud_list_cache_exists(struct gaim_connection *); extern void toc_build_config(struct gaim_connection *, char *, int len, gboolean); -extern void parse_toc_buddy_list(struct gaim_connection *, char *, int); +extern void parse_toc_buddy_list(struct gaim_connection *, char *); /* Functions in core.c */ extern gint UI_write(struct UI *, guchar *, int); Index: list.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/list.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- list.c 2001/09/28 07:46:36 1.1 +++ list.c 2001/10/17 20:24:11 1.2 @@ -331,7 +331,7 @@ } } -void parse_toc_buddy_list(struct gaim_connection *gc, char *config, int from_do_import) +void parse_toc_buddy_list(struct gaim_connection *gc, char *config) { char *c; char current[256]; @@ -352,8 +352,10 @@ break; if (*c == 'g') { strncpy(current, c + 2, sizeof(current)); - add_group(gc, current); - how_many++; + if (!find_group(gc, current)) { + add_group(gc, current); + how_many++; + } } else if (*c == 'b' && !find_buddy(gc, c + 2)) { char nm[80], sw[80], *tmp = c + 2; int i = 0; @@ -366,11 +368,11 @@ while (*tmp) sw[i++] = *tmp++; sw[i] = '\0'; - if (!find_buddy(gc, nm)) + if (!find_buddy(gc, nm)) { add_buddy(gc, current, nm, sw); - how_many++; - - bud = g_list_append(bud, c + 2); + how_many++; + bud = g_list_append(bud, c + 2); + } } else if (*c == 'p') { GSList *d = gc->permit; char *n; @@ -383,9 +385,10 @@ d = d->next; } g_free(n); - if (!d) + if (!d) { gc->permit = g_slist_append(gc->permit, name); - else + how_many++; + } else g_free(name); } else if (*c == 'd') { GSList *d = gc->deny; @@ -399,9 +402,10 @@ d = d->next; } g_free(n); - if (!d) + if (!d) { gc->deny = g_slist_append(gc->deny, name); - else + how_many++; + } else g_free(name); } else if (!strncmp("toc", c, 3)) { sscanf(c + strlen(c) - 1, "%d", &gc->permdeny); @@ -422,15 +426,9 @@ } serv_set_permit_deny(gc); } - - /* perhaps the server dropped the buddy list, try importing from - cache */ - if (how_many == 0 && !from_do_import) { - do_import(gc, NULL); - } else if (gc && (bud_list_cache_exists(gc) == FALSE)) { + if (how_many != 0) do_export(gc); - } } void toc_build_config(struct gaim_connection *gc, char *s, int len, gboolean show) @@ -727,7 +725,7 @@ return; } - parse_toc_buddy_list(gc, buf, 1); + parse_toc_buddy_list(gc, buf); fclose(f); |
From: Eric W. <war...@us...> - 2001-10-17 17:43:20
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv31910 Modified Files: multi.c Log Message: hi Index: multi.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- multi.c 2001/10/17 10:11:46 1.93 +++ multi.c 2001/10/17 17:43:17 1.94 @@ -558,6 +558,10 @@ gtk_widget_hide(u->checkmail); if (!(p->options & OPT_PROTO_BUDDY_ICON)) gtk_widget_hide(u->iconsel); + + if ((p->options & OPT_PROTO_BUDDY_ICON) || (p->options & OPT_PROTO_MAIL_CHECK)) + return; + gtk_widget_hide(u->user_frame); } static void generate_protocol_options(struct mod_user *u, GtkWidget *box) |
From: Rob F. <rob...@us...> - 2001-10-17 15:10:39
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv15567 Modified Files: ChangeLog Log Message: Drugs are bad, mmkay Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.320 retrieving revision 1.321 diff -u -d -r1.320 -r1.321 --- ChangeLog 2001/10/17 14:29:41 1.320 +++ ChangeLog 2001/10/17 15:10:36 1.321 @@ -8,8 +8,8 @@ * An extraordinary number of bug fixes * Updated Korean translation * Ability to stop animation on buddy icons, restart animation, - * hide certain buddy icons, and save people's buddy icons, all - * through a right-click menu + hide certain buddy icons, and save people's buddy icons, all + through a right-click menu * Event handlers in perl passed arguments as elements of an array rather than all concatenated as a string, making perl much easier to use (thanks Dennis Lambe Jr.) |
From: Rob F. <rob...@us...> - 2001-10-17 14:29:44
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv3337 Modified Files: ChangeLog Log Message: Hmm? Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.319 retrieving revision 1.320 diff -u -d -r1.319 -r1.320 --- ChangeLog 2001/10/17 10:11:45 1.319 +++ ChangeLog 2001/10/17 14:29:41 1.320 @@ -7,9 +7,9 @@ * Better applet icon drawing (thanks to Ari Pollak) * An extraordinary number of bug fixes * Updated Korean translation - * Ability to stop animation on buddy icons, hide certain - buddy icons, and save people's buddy icons, all through - a right-click menu + * Ability to stop animation on buddy icons, restart animation, + * hide certain buddy icons, and save people's buddy icons, all + * through a right-click menu * Event handlers in perl passed arguments as elements of an array rather than all concatenated as a string, making perl much easier to use (thanks Dennis Lambe Jr.) |
From: Eric W. <war...@us...> - 2001-10-17 10:11:48
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv15567 Modified Files: ChangeLog Log Message: i didn't rewrite a good majority of your patch, sean. i changed the logic for when to hide user_frame slightly (remove the ! and flip the hide/show); had each of the generate_*_options take the vbox and create their own frame; and i think that's about it. you new i was going to do that anyway. Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.318 retrieving revision 1.319 diff -u -d -r1.318 -r1.319 --- ChangeLog 2001/10/15 20:08:14 1.318 +++ ChangeLog 2001/10/17 10:11:45 1.319 @@ -15,6 +15,7 @@ perl much easier to use (thanks Dennis Lambe Jr.) * Can pass an argument to timeout_handlers in perl (thanks Artem Litvinovich) + * Redesigned Modify Account window (thanks Sean Egan) version 0.45 (10/04/2001): * New plugin event: event_chat_send_invite |
From: Eric W. <war...@us...> - 2001-10-17 10:11:48
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv15567/src Modified Files: multi.c ui.h Log Message: i didn't rewrite a good majority of your patch, sean. i changed the logic for when to hide user_frame slightly (remove the ! and flip the hide/show); had each of the generate_*_options take the vbox and create their own frame; and i think that's about it. you new i was going to do that anyway. Index: multi.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- multi.c 2001/10/09 18:12:41 1.92 +++ multi.c 2001/10/17 10:11:46 1.93 @@ -59,7 +59,7 @@ return NULL; } -static void generate_prpl_options(struct mod_user *, GtkWidget *); +static void generate_protocol_options(struct mod_user *, GtkWidget *); struct mod_usr_opt { struct mod_user *user; @@ -309,8 +309,13 @@ gtk_widget_hide(u->iconsel); } + if ((q->options & OPT_PROTO_BUDDY_ICON) || (q->options & OPT_PROTO_MAIL_CHECK)) + gtk_widget_show(u->user_frame); + else + gtk_widget_hide(u->user_frame); + u->protocol = proto; - generate_prpl_options(u, u->main); + generate_protocol_options(u, u->main); } } @@ -455,21 +460,21 @@ return hbox; } -static void generate_general_options(struct mod_user *u, GtkWidget *book) +static void generate_login_options(struct mod_user *u, GtkWidget *box) { + GtkWidget *frame; GtkWidget *vbox; GtkWidget *hbox; - GtkWidget *pwdbox; GtkWidget *label; - GtkWidget *name; - GtkWidget *pass; - GtkWidget *rempass; - GtkWidget *checkmail; - GtkWidget *iconsel; + + struct prpl *p; + + frame = gtk_frame_new("Login Options"); + gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0); vbox = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); - gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new(_("General Options"))); + gtk_container_add(GTK_CONTAINER(frame), vbox); hbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); @@ -477,18 +482,18 @@ label = gtk_label_new(_("Screenname:")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - name = gtk_entry_new(); - gtk_box_pack_start(GTK_BOX(hbox), name, TRUE, TRUE, 0); + u->name = gtk_entry_new(); + gtk_box_pack_start(GTK_BOX(hbox), u->name, TRUE, TRUE, 0); - pwdbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(vbox), pwdbox, FALSE, FALSE, 0); + u->pwdbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(vbox), u->pwdbox, FALSE, FALSE, 0); label = gtk_label_new(_("Password:")); - gtk_box_pack_start(GTK_BOX(pwdbox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(u->pwdbox), label, FALSE, FALSE, 0); - pass = gtk_entry_new(); - gtk_box_pack_start(GTK_BOX(pwdbox), pass, TRUE, TRUE, 0); - gtk_entry_set_visibility(GTK_ENTRY(pass), FALSE); + u->pass = gtk_entry_new(); + gtk_box_pack_start(GTK_BOX(u->pwdbox), u->pass, TRUE, TRUE, 0); + gtk_entry_set_visibility(GTK_ENTRY(u->pass), FALSE); hbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); @@ -499,29 +504,63 @@ make_protocol_menu(hbox, u); - rempass = acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox); + u->rempass = acct_button(_("Remember Password"), u, OPT_USR_REM_PASS, vbox); acct_button(_("Auto-Login"), u, OPT_USR_AUTO, vbox); - /*acct_button(_("Send KeepAlive packet (6 bytes/second)"), u, OPT_USR_KEEPALV, vbox); */ - checkmail = acct_button(_("New Mail Notifications"), u, OPT_USR_MAIL_CHECK, vbox); - - iconsel = build_icon_selection(u, vbox); - gtk_widget_show_all(vbox); + gtk_widget_show_all(frame); - u->name = name; - u->pwdbox = pwdbox; - u->pass = pass; - u->rempass = rempass; - u->checkmail = checkmail; - u->iconsel = iconsel; if (u->user) { - gtk_entry_set_text(GTK_ENTRY(name), u->user->username); - gtk_entry_set_text(GTK_ENTRY(pass), u->user->password); - gtk_entry_set_editable(GTK_ENTRY(name), FALSE); + gtk_entry_set_text(GTK_ENTRY(u->name), u->user->username); + gtk_entry_set_text(GTK_ENTRY(u->pass), u->user->password); + gtk_entry_set_editable(GTK_ENTRY(u->name), FALSE); } + + p = find_prpl(u->protocol); + if (p && (p->options & OPT_PROTO_NO_PASSWORD)) { + gtk_widget_hide(u->pwdbox); + gtk_widget_hide(u->rempass); + } } -static void generate_prpl_options(struct mod_user *u, GtkWidget *book) +static void generate_user_options(struct mod_user *u, GtkWidget *box) +{ + /* This function will add the appropriate (depending on the current + * protocol) widgets to frame and return TRUE if there anything + * was added (meaning the frame should be shown) + * Eric will most likely change this (as he does all other submitted code) + * so that it will accept the vbox as an argument and create, add, and show + * the frame itself (like generate_protocol_options). I'd do it myself, but I'm + * tired and I don't care. */ + /* Sean was right. I did do that. I told him I would. */ + + GtkWidget *vbox; + + struct prpl *p = find_prpl(u->protocol); + + u->user_frame = gtk_frame_new("User Options"); + gtk_box_pack_start(GTK_BOX(box), u->user_frame, FALSE, FALSE, 0); + gtk_widget_show(u->user_frame); + + vbox = gtk_vbox_new(FALSE, 5); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(u->user_frame), vbox); + gtk_widget_show(vbox); + + u->checkmail = acct_button(_("New Mail Notifications"), u, OPT_USR_MAIL_CHECK, vbox); + u->iconsel = build_icon_selection(u, vbox); + + if (!p) { + gtk_widget_hide(u->user_frame); + return; + } + + if (!(p->options & OPT_PROTO_MAIL_CHECK)) + gtk_widget_hide(u->checkmail); + if (!(p->options & OPT_PROTO_BUDDY_ICON)) + gtk_widget_hide(u->iconsel); +} + +static void generate_protocol_options(struct mod_user *u, GtkWidget *box) { struct prpl *p = find_prpl(u->protocol); @@ -534,28 +573,34 @@ char buf[256]; - /* page 0 is general, keep it. page 1 is options for our - * particular protocol, so clear it out and make a new one. */ - - gtk_notebook_remove_page(GTK_NOTEBOOK(book), 1); - - if (!p) - return; + if (u->proto_frame) + gtk_widget_destroy(u->proto_frame); + u->proto_frame = NULL; if (u->opt_entries) { g_list_free(u->opt_entries); u->opt_entries = NULL; } + if (!p) + return; + if (!p->user_opts) return; tmp = op = (*p->user_opts)(); + if (!op) + return; + + g_snprintf(buf, sizeof(buf), "%s Options", (*p->name)()); + u->proto_frame = gtk_frame_new(buf); + gtk_box_pack_start(GTK_BOX(box), u->proto_frame, FALSE, FALSE, 0); + gtk_widget_show(u->proto_frame); + vbox = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); - g_snprintf(buf, sizeof(buf), "%s Options", (*p->name)()); - gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new(buf)); + gtk_container_add(GTK_CONTAINER(u->proto_frame), vbox); gtk_widget_show(vbox); while (op) { @@ -590,20 +635,15 @@ static void show_acct_mod(struct aim_user *a) { - /* here we can have all the aim_user options, including ones not shown in the main acctedit - * window. this can keep the size of the acctedit window small and readable, and make this - * one the powerful editor. this is where things like name/password are edited, but can - * also have toggles (and even more complex options) like whether to autologin or whether - * to send keepalives or whatever. this would be the perfect place to specify which protocol - * to use. make sure to account for the possibility of protocol plugins. */ - GtkWidget *mod; - GtkWidget *box; - GtkWidget *book; + /* This is the fucking modify account dialog. I've fucking seperated it into + * three fucking frames: + * a fucking Login Options frame, a fucking User Options frame and a fucking + * Protcol Options frame. This fucking removes the two fucking tabs, which were + * quite fucking uneccessary. Fuck. */ + /* -- SeanEgan */ GtkWidget *hbox; GtkWidget *button; - struct prpl *p; - struct mod_user *u = find_mod_user(a); if (!u) { @@ -637,55 +677,39 @@ gtk_widget_show(u->mod); return; } - - mod = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_wmclass(GTK_WINDOW(mod), "account", "Gaim"); - gtk_widget_realize(mod); - aol_icon(mod->window); - gtk_window_set_title(GTK_WINDOW(mod), _("Gaim - Modify Account")); - gtk_window_set_policy(GTK_WINDOW(mod), FALSE, TRUE, TRUE); /* nothing odd here :) */ - gtk_signal_connect(GTK_OBJECT(mod), "destroy", GTK_SIGNAL_FUNC(delmod), u); - box = gtk_vbox_new(FALSE, 5); - gtk_container_border_width(GTK_CONTAINER(mod), 5); - gtk_container_add(GTK_CONTAINER(mod), box); - gtk_widget_show(box); + u->mod = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_wmclass(GTK_WINDOW(u->mod), "account", "Gaim"); + gtk_widget_realize(u->mod); + aol_icon(u->mod->window); + gtk_window_set_title(GTK_WINDOW(u->mod), _("Gaim - Modify Account")); + gtk_window_set_policy(GTK_WINDOW(u->mod), FALSE, TRUE, TRUE); /* nothing odd here :) */ + gtk_signal_connect(GTK_OBJECT(u->mod), "destroy", GTK_SIGNAL_FUNC(delmod), u); - book = gtk_notebook_new(); - gtk_box_pack_start(GTK_BOX(box), book, FALSE, FALSE, 0); - gtk_widget_show(book); + u->main = gtk_vbox_new(FALSE, 5); + gtk_container_border_width(GTK_CONTAINER(u->main), 5); + gtk_container_add(GTK_CONTAINER(u->mod), u->main); + gtk_widget_show(u->main); - generate_general_options(u, book); - generate_prpl_options(u, book); + generate_login_options(u, u->main); + generate_user_options(u, u->main); + generate_protocol_options(u, u->main); hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); + gtk_box_pack_end(GTK_BOX(u->main), hbox, FALSE, FALSE, 0); gtk_widget_show(hbox); - button = picture_button(mod, _("Cancel"), cancel_xpm); + button = picture_button(u->mod, _("Cancel"), cancel_xpm); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(cancel_mod), u); gtk_widget_show(button); - button = picture_button(mod, _("OK"), ok_xpm); + button = picture_button(u->mod, _("OK"), ok_xpm); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_mod), u); gtk_widget_show(button); - - u->mod = mod; - u->main = book; /* sorry, i think i broke the joke :) */ - p = find_prpl(u->protocol); - if (p && (p->options & OPT_PROTO_NO_PASSWORD)) { - gtk_widget_hide(u->pwdbox); - gtk_widget_hide(u->rempass); - } - if (p && (!(p->options & OPT_PROTO_MAIL_CHECK))) - gtk_widget_hide(u->checkmail); - if (p && (!(p->options & OPT_PROTO_BUDDY_ICON))) - gtk_widget_hide(u->iconsel); - - gtk_widget_show(mod); + gtk_widget_show(u->mod); } static void add_acct(GtkWidget *w, gpointer d) Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ui.h 2001/10/16 01:12:36 1.10 +++ ui.h 2001/10/17 10:11:46 1.11 @@ -155,7 +155,6 @@ #if USE_PIXBUF /* buddy icon stuff. sigh. */ GtkWidget *icon; - GdkPixbuf *unanim; GdkPixbufAnimation *anim; guint32 icon_timer; int frame; @@ -202,6 +201,8 @@ GtkWidget *pwdbox; GtkWidget *pass; GtkWidget *rempass; + GtkWidget *user_frame; + GtkWidget *proto_frame; GList *opt_entries; /* stuff for icon selection */ |
From: Eric W. <war...@us...> - 2001-10-17 01:33:03
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv24507 Modified Files: conversation.c Log Message: er. Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.281 retrieving revision 1.282 diff -u -d -r1.281 -r1.282 --- conversation.c 2001/10/15 21:04:37 1.281 +++ conversation.c 2001/10/17 01:33:00 1.282 @@ -2574,11 +2574,9 @@ #if USE_PIXBUF #include <gdk-pixbuf/gdk-pixbuf.h> -#include <gdk-pixbuf/gdk-pixbuf-loader.h> #define SCALE(x) ((gdk_pixbuf_animation_get_width(x) <= 48 && gdk_pixbuf_animation_get_height(x) <= 48) \ ? 48 : 50) -#define SCALEBUF(x) ((gdk_pixbuf_get_width(x) <= 48 && gdk_pixbuf_get_height(x) <= 48) ? 48 : 50) static gboolean redraw_icon(gpointer data) { @@ -2790,9 +2788,6 @@ if (c->anim) gdk_pixbuf_animation_unref(c->anim); c->anim = NULL; - if (c->unanim) - gdk_pixbuf_unref(c->unanim); - c->unanim = NULL; if (c->icon_timer) gtk_timeout_remove(c->icon_timer); c->icon_timer = 0; @@ -2803,11 +2798,16 @@ void update_icon(struct conversation *c) { #if USE_PIXBUF + char filename[256]; + FILE *file; + void *data; int len; + GList *frames; + GdkPixbuf *buf; + GtkWidget *event; - GdkPixbufLoader *load; GdkPixbuf *scale; GdkPixmap *pm; GdkBitmap *bm; @@ -2828,34 +2828,36 @@ if (!data) return; - load = gdk_pixbuf_loader_new(); - gdk_pixbuf_loader_write(load, data, len); - c->anim = gdk_pixbuf_loader_get_animation(load); + /* this is such an evil hack, i don't know why i'm even considering it. + * we'll do it differently when gdk-pixbuf-loader isn't leaky anymore. */ + g_snprintf(filename, sizeof(filename), "%s/gaimicon-%s.%d", g_get_tmp_dir(), c->name, getpid()); + file = fopen(filename, "w"); + if (!file) + return; + fwrite(data, 1, len, file); + fclose(file); - if (c->anim) { - GList *frames = gdk_pixbuf_animation_get_frames(c->anim); - GdkPixbuf *buf = gdk_pixbuf_frame_get_pixbuf(frames->data); - sf = SCALE(c->anim); - scale = gdk_pixbuf_scale_simple(buf, - MAX(gdk_pixbuf_get_width(buf) * sf / - gdk_pixbuf_animation_get_width(c->anim), 1), - MAX(gdk_pixbuf_get_height(buf) * sf / - gdk_pixbuf_animation_get_height(c->anim), 1), - GDK_INTERP_NEAREST); + c->anim = gdk_pixbuf_animation_new_from_file(filename); + /* make sure we remove the file as soon as possible */ + unlink(filename); - if (gdk_pixbuf_animation_get_num_frames(c->anim) > 1) { - int delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13); - c->frame = 1; - c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); - } - } else { - c->unanim = gdk_pixbuf_loader_get_pixbuf(load); - if (!c->unanim) { - gdk_pixbuf_loader_close(load); - return; - } - sf = SCALEBUF(c->unanim); - scale = gdk_pixbuf_scale_simple(c->unanim, sf, sf, GDK_INTERP_NEAREST); + if (!c->anim) + return; + + frames = gdk_pixbuf_animation_get_frames(c->anim); + buf = gdk_pixbuf_frame_get_pixbuf(frames->data); + sf = SCALE(c->anim); + scale = gdk_pixbuf_scale_simple(buf, + MAX(gdk_pixbuf_get_width(buf) * sf / + gdk_pixbuf_animation_get_width(c->anim), 1), + MAX(gdk_pixbuf_get_height(buf) * sf / + gdk_pixbuf_animation_get_height(c->anim), 1), + GDK_INTERP_NEAREST); + + if (gdk_pixbuf_animation_get_num_frames(c->anim) > 1) { + int delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13); + c->frame = 1; + c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); } gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); @@ -2873,8 +2875,6 @@ gdk_pixmap_unref(pm); if (bm) gdk_bitmap_unref(bm); - - gdk_pixbuf_loader_close(load); #endif } |
From: Eric W. <war...@us...> - 2001-10-16 23:37:14
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv3098 Modified Files: HACKING Log Message: hi again Index: HACKING =================================================================== RCS file: /cvsroot/gaim/gaim/HACKING,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- HACKING 2001/10/16 23:34:26 1.24 +++ HACKING 2001/10/16 23:37:11 1.25 @@ -34,7 +34,8 @@ section, or email it to ga...@ma.... This file was last modified by $Author$ on -$Date$. +$Date$. Do not expect any information contained +within to be current or correct. CODING STYLE |
From: Eric W. <war...@us...> - 2001-10-16 23:34:29
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv2424 Modified Files: HACKING Log Message: hi. Index: HACKING =================================================================== RCS file: /cvsroot/gaim/gaim/HACKING,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- HACKING 2001/09/20 08:20:32 1.23 +++ HACKING 2001/10/16 23:34:26 1.24 @@ -30,7 +30,8 @@ friend.) To make a patch, just edit the files right there in that tree (don't bother with two trees, or even two copies of the same file). Then when you're ready to make your patch, simply run 'cvs diff -u >my.patch' -and send it off. +and send it off; either post it on sf.net/projects/gaim in the patches +section, or email it to ga...@ma.... This file was last modified by $Author$ on $Date$. |
From: Eric W. <war...@us...> - 2001-10-16 23:24:37
|
Update of /cvsroot/gaim/gaim/src/protocols/gg In directory usw-pr-cvs1:/tmp/cvs-serv32703/src/protocols/gg Modified Files: gg.c Log Message: don't delete buddy list Index: gg.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/gg/gg.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gg.c 2001/10/14 11:36:36 1.3 +++ gg.c 2001/10/16 23:24:34 1.4 @@ -523,7 +523,8 @@ account_online(gc); serv_finish_login(gc); - do_import(gc, NULL); + if (bud_list_cache_exists(gc)) + do_import(gc, NULL); break; case GG_EVENT_CONN_FAILED: gaim_input_remove(gc->inpa); |
From: Eric W. <war...@us...> - 2001-10-16 23:24:37
|
Update of /cvsroot/gaim/gaim/src/protocols/toc In directory usw-pr-cvs1:/tmp/cvs-serv32703/src/protocols/toc Modified Files: toc.c Log Message: don't delete buddy list Index: toc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/toc/toc.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- toc.c 2001/10/14 11:36:36 1.26 +++ toc.c 2001/10/16 23:24:35 1.27 @@ -551,7 +551,8 @@ account_online(gc); serv_finish_login(gc); - do_import(gc, NULL); + if (bud_list_cache_exists(gc)) + do_import(gc, NULL); /* Client sends TOC toc_init_done message */ debug_printf("* Client sends TOC toc_init_done message\n"); @@ -586,7 +587,8 @@ signoff(gc); return; } - do_import(gc, NULL); + if (bud_list_cache_exists(gc)) + do_import(gc, NULL); g_snprintf(snd, sizeof snd, "toc_init_done"); sflap_send(gc, snd, -1, TYPE_DATA); do_error_dialog(_("TOC has come back from its pause. You may now send" |
From: Eric W. <war...@us...> - 2001-10-16 19:37:50
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv2099 Modified Files: gtkspell.c Log Message: hm Index: gtkspell.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkspell.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gtkspell.c 2001/10/09 19:24:16 1.11 +++ gtkspell.c 2001/10/16 19:37:47 1.12 @@ -315,6 +315,10 @@ static int misspelled_test(char *word) { char *buf; + + if (word == NULL) + return 0; + buf = g_strdup_printf("^%s\n", word); /* guard against ispell control chars */ writetext(buf); g_free(buf); |
From: Eric W. <war...@us...> - 2001-10-16 18:12:36
|
Update of /cvsroot/gaim/gaim/src/protocols/icq In directory usw-pr-cvs1:/tmp/cvs-serv1634 Modified Files: gaim_icq.c Log Message: so is this Index: gaim_icq.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/icq/gaim_icq.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- gaim_icq.c 2001/10/16 18:11:15 1.15 +++ gaim_icq.c 2001/10/16 18:12:33 1.16 @@ -80,11 +80,12 @@ struct gaim_connection *gc = link->icq_UserData; struct icq_data *id = (struct icq_data *)gc->proto_data; debug_printf("%s is now online.\n", gc->username); - id->connected = TRUE; - account_online(gc); - serv_finish_login(gc); - - icq_ChangeStatus(id->link, STATUS_ONLINE); + if (!id->connected) { + account_online(gc); + serv_finish_login(gc); + icq_ChangeStatus(id->link, STATUS_ONLINE); + id->connected = TRUE; + } } static void icq_logged_off(icq_Link *link) { @@ -103,8 +104,7 @@ return; } - icq_Login(link, STATUS_ONLINE); - id->cur_status = STATUS_ONLINE; + icq_Login(link, id->cur_status); } void strip_linefeed(gchar *text) @@ -319,8 +319,8 @@ return; } - icq_Login(link, STATUS_ONLINE); id->cur_status = STATUS_ONLINE; + icq_Login(link, STATUS_ONLINE); set_login_progress(gc, 0, "Connecting..."); } |
From: Eric W. <war...@us...> - 2001-10-16 18:11:21
|
Update of /cvsroot/gaim/gaim/src/protocols/icq In directory usw-pr-cvs1:/tmp/cvs-serv26001/protocols/icq Modified Files: gaim_icq.c Log Message: this is better, hopefully. Index: gaim_icq.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/icq/gaim_icq.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gaim_icq.c 2001/10/14 11:36:36 1.14 +++ gaim_icq.c 2001/10/16 18:11:15 1.15 @@ -18,6 +18,7 @@ struct icq_data { icq_Link *link; int cur_status; + gboolean connected; }; static guint ack_timer = 0; @@ -79,8 +80,8 @@ struct gaim_connection *gc = link->icq_UserData; struct icq_data *id = (struct icq_data *)gc->proto_data; debug_printf("%s is now online.\n", gc->username); + id->connected = TRUE; account_online(gc); - /*gc->options |= OPT_USR_KEEPALV; this is always-on now */ serv_finish_login(gc); icq_ChangeStatus(id->link, STATUS_ONLINE); @@ -89,6 +90,12 @@ static void icq_logged_off(icq_Link *link) { struct gaim_connection *gc = link->icq_UserData; struct icq_data *id = (struct icq_data *)gc->proto_data; + + if (!id->connected) { + hide_login_progress(gc, "Unable to connect"); + signoff(gc); + return; + } if (icq_Connect(link, "icq.mirabilis.com", 4000) < 1) { hide_login_progress(gc, "Unable to connect"); |
From: Eric W. <war...@us...> - 2001-10-16 01:12:39
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv1769 Modified Files: ui.h Log Message: sorry sean. Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ui.h 2001/10/14 03:54:40 1.9 +++ ui.h 2001/10/16 01:12:36 1.10 @@ -137,16 +137,6 @@ GtkWidget *check; gboolean unseen; -#if USE_PIXBUF - /* buddy icon stuff. sigh. */ - GtkWidget *icon; - GdkPixbuf *unanim; - GdkPixbufAnimation *anim; - guint32 icon_timer; - int frame; - GtkWidget *save_icon; -#endif - /* stuff used just for chat */ GList *in_room; GList *ignored; @@ -161,6 +151,16 @@ /* something to distinguish */ gboolean is_chat; + +#if USE_PIXBUF + /* buddy icon stuff. sigh. */ + GtkWidget *icon; + GdkPixbuf *unanim; + GdkPixbufAnimation *anim; + guint32 icon_timer; + int frame; + GtkWidget *save_icon; +#endif }; struct log_conversation { |
From: Eric W. <war...@us...> - 2001-10-15 21:04:40
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv7950 Modified Files: conversation.c Log Message: ability to reenable animation. Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.280 retrieving revision 1.281 diff -u -d -r1.280 -r1.281 --- conversation.c 2001/10/14 18:31:29 1.280 +++ conversation.c 2001/10/15 21:04:37 1.281 @@ -2670,6 +2670,18 @@ c->icon_timer = 0; } +static void start_anim(GtkObject *obj, struct conversation *c) +{ + GList *frames; + GdkPixbufFrame *frame; + int delay; + + frames = gdk_pixbuf_animation_get_frames(c->anim); + frame = g_list_nth_data(frames, c->frame); + delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13); + c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); +} + static int des_save_icon(GtkObject *obj, GdkEvent *e, struct conversation *c) { gtk_widget_destroy(c->save_icon); @@ -2743,6 +2755,11 @@ if (c->icon_timer) { button = gtk_menu_item_new_with_label(_("Disable Animation")); gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(stop_anim), c); + gtk_menu_append(GTK_MENU(menu), button); + gtk_widget_show(button); + } else if (c->anim) { + button = gtk_menu_item_new_with_label(_("Enable Animation")); + gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(start_anim), c); gtk_menu_append(GTK_MENU(menu), button); gtk_widget_show(button); } |
From: Eric W. <war...@us...> - 2001-10-15 20:08:17
|
Update of /cvsroot/gaim/gaim/plugins In directory usw-pr-cvs1:/tmp/cvs-serv13181/plugins Modified Files: PERL-HOWTO Log Message: Artem Litvinovich's patch Index: PERL-HOWTO =================================================================== RCS file: /cvsroot/gaim/gaim/plugins/PERL-HOWTO,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- PERL-HOWTO 2001/10/15 19:52:44 1.11 +++ PERL-HOWTO 2001/10/15 20:08:14 1.12 @@ -136,6 +136,8 @@ and the event itself to never happen (i.e. the user won't see it happen, and _send events won't actually send). -GAIM::add_timeout_handler(integer, function) +GAIM::add_timeout_handler(integer, function, args) This calls function after integer number of seconds. It only calls function once, so if you want to keep calling function, keep readding the handler. + Args is a string that you'd like to have passed to your timeout handler; it's + optional. |
From: Eric W. <war...@us...> - 2001-10-15 20:08:17
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv13181 Modified Files: ChangeLog Log Message: Artem Litvinovich's patch Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.317 retrieving revision 1.318 diff -u -d -r1.317 -r1.318 --- ChangeLog 2001/10/15 19:52:44 1.317 +++ ChangeLog 2001/10/15 20:08:14 1.318 @@ -13,6 +13,8 @@ * Event handlers in perl passed arguments as elements of an array rather than all concatenated as a string, making perl much easier to use (thanks Dennis Lambe Jr.) + * Can pass an argument to timeout_handlers in perl + (thanks Artem Litvinovich) version 0.45 (10/04/2001): * New plugin event: event_chat_send_invite |
From: Eric W. <war...@us...> - 2001-10-15 20:08:17
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv13181/src Modified Files: perl.c Log Message: Artem Litvinovich's patch Index: perl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/perl.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- perl.c 2001/10/15 19:52:44 1.61 +++ perl.c 2001/10/15 20:08:15 1.62 @@ -74,6 +74,7 @@ struct _perl_timeout_handlers { char *handler_name; + char *handler_args; gint iotag; }; @@ -260,6 +261,7 @@ thn = perl_timeout_handlers->data; perl_timeout_handlers = g_list_remove(perl_timeout_handlers, thn); g_source_remove(thn->iotag); + g_free(thn->handler_args); g_free(thn->handler_name); g_free(thn); } @@ -804,8 +806,9 @@ static int perl_timeout(gpointer data) { struct _perl_timeout_handlers *handler = data; - execute_perl(handler->handler_name, ""); + execute_perl(handler->handler_name, escape_quotes(handler->handler_args)); perl_timeout_handlers = g_list_remove(perl_timeout_handlers, handler); + g_free(handler->handler_args); g_free(handler->handler_name); g_free(handler); @@ -824,6 +827,7 @@ timeout = 1000 * SvIV(ST(0)); debug_printf("Adding timeout for %d seconds.\n", timeout/1000); handler->handler_name = g_strdup(SvPV(ST(1), junk)); + handler->handler_args = g_strdup(SvPV(ST(2), junk)); perl_timeout_handlers = g_list_append(perl_timeout_handlers, handler); handler->iotag = g_timeout_add(timeout, perl_timeout, handler); XSRETURN_EMPTY; |
From: Eric W. <war...@us...> - 2001-10-15 19:52:47
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv5281/src Modified Files: aim.c core.h module.c perl.c Log Message: malsyned's patch for args in perl. Index: aim.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/aim.c,v retrieving revision 1.166 retrieving revision 1.167 diff -u -d -r1.166 -r1.167 --- aim.c 2001/10/14 05:52:36 1.166 +++ aim.c 2001/10/15 19:52:44 1.167 @@ -569,6 +569,7 @@ signal(SIGHUP, sighandler); signal(SIGINT, sighandler); signal(SIGTERM, sighandler); + signal(SIGQUIT, sighandler); signal(SIGPIPE, SIG_IGN); #endif Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- core.h 2001/10/14 11:36:36 1.8 +++ core.h 2001/10/15 19:52:44 1.9 @@ -169,7 +169,7 @@ #ifdef USE_PERL extern void perl_autoload(); extern void perl_end(); -extern int perl_event(char *, char *); +extern int perl_event(enum gaim_event, void *, void *, void *, void *); extern int perl_load_file(char *); extern void unload_perl_scripts(); extern void list_perl_scripts(); @@ -186,6 +186,7 @@ extern void remove_all_plugins(); #endif extern int plugin_event(enum gaim_event, void *, void *, void *, void *); +extern char *event_name(enum gaim_event); /* Functions in server.c */ extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int, gushort); Index: module.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/module.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- module.c 2001/10/12 22:31:12 1.11 +++ module.c 2001/10/15 19:52:44 1.12 @@ -175,7 +175,7 @@ void gaim_plugin_unload(GModule *handle) { GList *pl = plugins; - struct gaim_plugin *p; + struct gaim_plugin *p = NULL; void (*gaim_plugin_remove)(); while (pl) { @@ -269,7 +269,7 @@ #endif /* GAIM_PLUGINS */ -static char *event_name(enum gaim_event event) +char *event_name(enum gaim_event event) { static char buf[128]; switch (event) { @@ -468,9 +468,6 @@ int plugin_event(enum gaim_event event, void *arg1, void *arg2, void *arg3, void *arg4) { -#ifdef USE_PERL - char buf[BUF_LONG]; -#endif #ifdef GAIM_PLUGINS GList *c = callbacks; struct gaim_callback *g; @@ -487,7 +484,7 @@ void (*four)(void *, void *, void *, void *, void *); g = (struct gaim_callback *)c->data; - if (g->event == event && g->function !=NULL) { + if (g->event == event && g->function != NULL) { switch (event) { /* no args */ @@ -553,81 +550,7 @@ } #endif /* GAIM_PLUGINS */ #ifdef USE_PERL - switch (event) { - case event_signon: - case event_signoff: - g_snprintf(buf, sizeof buf, "%lu", (unsigned long)arg1); - break; - case event_away: - g_snprintf(buf, sizeof buf, "%lu %s", (unsigned long)arg1, - ((struct gaim_connection *)arg1)->away ? - ((struct gaim_connection *)arg1)->away : ""); - break; - case event_im_recv: - g_snprintf(buf, sizeof buf, "%lu \"%s\" %s", (unsigned long)arg1, - *(char **)arg2 ? *(char **)arg2 : "(null)", - *(char **)arg3 ? *(char **)arg3 : "(null)"); - break; - case event_im_send: - g_snprintf(buf, sizeof buf, "%lu \"%s\" %s", (unsigned long)arg1, - (char *)arg2, *(char **)arg3 ? *(char **)arg3 : "(null)"); - break; - case event_buddy_signon: - case event_buddy_signoff: - case event_set_info: - case event_buddy_away: - case event_buddy_back: - case event_buddy_idle: - case event_buddy_unidle: - g_snprintf(buf, sizeof buf, "%lu \"%s\"", (unsigned long)arg1, (char *)arg2); - break; - case event_chat_invited: - g_snprintf(buf, sizeof buf, "%lu \"%s\" \"%s\" %s", (unsigned long)arg1, - (char *)arg2, (char *)arg3, arg4 ? (char *)arg4 : ""); - break; - case event_chat_join: - case event_chat_buddy_join: - case event_chat_buddy_leave: - g_snprintf(buf, sizeof buf, "%lu %d \"%s\"", (unsigned long)arg1, - (int)arg2, (char *)arg3); - break; - case event_chat_leave: - g_snprintf(buf, sizeof buf, "%lu %d", (unsigned long)arg1, (int)arg2); - break; - case event_chat_recv: - g_snprintf(buf, sizeof buf, "%lu %d \"%s\" %s", (unsigned long)arg1, - (int)arg2, (char *)arg3, (char *)arg4 ? (char *)arg4 : "(null)"); - break; - case event_chat_send_invite: - g_snprintf(buf, sizeof buf, "%lu %d \"%s\" %s", (unsigned long)arg1, - (int)arg2, (char *)arg3, *(char **)arg4 ? *(char **)arg4 : "(null)"); - break; - case event_chat_send: - g_snprintf(buf, sizeof buf, "%lu %d %s", (unsigned long)arg1, (int)arg2, - *(char **)arg3 ? *(char **)arg3 : "(null)"); - break; - case event_warned: - g_snprintf(buf, sizeof buf, "%lu \"%s\" %d", (unsigned long)arg1, - arg2 ? (char *)arg2 : "", (int)arg3); - break; - case event_quit: - buf[0] = 0; - break; - case event_new_conversation: - g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg1); - break; - case event_im_displayed_sent: - g_snprintf(buf, sizeof buf, "%lu \"%s\" %s", (unsigned long)arg1, - (char *)arg2, *(char **)arg3 ? *(char **)arg3 : "(null)"); - break; - case event_im_displayed_rcvd: - g_snprintf(buf, sizeof buf, "%lu \"%s\" %s", (unsigned long)arg1, - (char *)arg2, (char *)arg3 ? (char *)arg3 : "(null)"); - break; - default: - return 0; - } - return perl_event(event_name(event), buf); + return perl_event(event, arg1, arg2, arg3, arg4); #else return 0; #endif Index: perl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/perl.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- perl.c 2001/10/12 06:59:25 1.60 +++ perl.c 2001/10/15 19:52:44 1.61 @@ -131,24 +131,28 @@ static SV *execute_perl(char *function, char *args) { static char *perl_cmd = NULL; + SV *i; if (perl_cmd) g_free(perl_cmd); - perl_cmd = g_malloc(strlen(function) + (strlen(args) * 2) + 2 + 10); - sprintf(perl_cmd, "&%s('%s')", function, escape_quotes(args)); + perl_cmd = g_malloc(strlen(function) + strlen(args) + 4); + sprintf(perl_cmd, "&%s(%s)", function, args); #ifndef HAVE_PERL_EVAL_PV - return (perl_eval_pv(perl_cmd, TRUE)); + i = (perl_eval_pv(perl_cmd, TRUE)); #else - return (Perl_eval_pv(perl_cmd, TRUE)); + i = (Perl_eval_pv(perl_cmd, TRUE)); #endif + return i; } int perl_load_file(char *script_name) { + char *name = g_strdup_printf("'%s'", escape_quotes(script_name)); SV *return_val; if (my_perl == NULL) perl_init(); - return_val = execute_perl("load_file", script_name); + return_val = execute_perl("load_file", name); + g_free(name); return SvNV (return_val); } @@ -643,20 +647,141 @@ XSRETURN(0); } -int perl_event(char *event, char *args) +int perl_event(enum gaim_event event, void *arg1, void *arg2, void *arg3, void *arg4) { + char *buf = NULL; GList *handler; struct _perl_event_handlers *data; SV *handler_return; + switch (event) { + case event_signon: + case event_signoff: + buf = g_strdup_printf("'%lu'", (unsigned long)arg1); + break; + case event_away: + buf = g_strdup_printf("'%lu','%s'", (unsigned long)arg1, + ((struct gaim_connection *)arg1)->away ? + escape_quotes(((struct gaim_connection *)arg1)->away) : ""); + break; + case event_im_recv: + { + char *tmp = *(char **)arg2 ? g_strdup(escape_quotes(*(char **)arg2)) : g_malloc0(1); + buf = g_strdup_printf("'%lu','%s','%s'", (unsigned long)arg1, tmp, + *(char **)arg3 ? escape_quotes(*(char **)arg3) : ""); + g_free(tmp); + } + break; + case event_im_send: + { + char *tmp = arg2 ? g_strdup(escape_quotes(arg2)) : g_malloc0(1); + buf = g_strdup_printf("'%lu','%s','%s'", (unsigned long)arg1, tmp, + *(char **)arg3 ? escape_quotes(*(char **)arg3) : ""); + g_free(tmp); + } + break; + case event_buddy_signon: + case event_buddy_signoff: + case event_set_info: + case event_buddy_away: + case event_buddy_back: + case event_buddy_idle: + case event_buddy_unidle: + buf = g_strdup_printf("'%lu','%s'", (unsigned long)arg1, escape_quotes(arg2)); + break; + case event_chat_invited: + { + char *tmp2, *tmp3, *tmp4; + tmp2 = g_strdup(escape_quotes(arg2)); + tmp3 = g_strdup(escape_quotes(arg3)); + tmp4 = arg4 ? g_strdup(escape_quotes(arg4)) : g_malloc0(1); + buf = g_strdup_printf("'%lu','%s','%s','%s'", (unsigned long)arg1, tmp2, tmp3, tmp4); + g_free(tmp2); + g_free(tmp3); + g_free(tmp4); + } + break; + case event_chat_join: + case event_chat_buddy_join: + case event_chat_buddy_leave: + buf = g_strdup_printf("'%lu','%d','%s'", (unsigned long)arg1, (int)arg2, + escape_quotes(arg3)); + break; + case event_chat_leave: + buf = g_strdup_printf("'%lu','%d'", (unsigned long)arg1, (int)arg2); + break; + case event_chat_recv: + { + char *t3, *t4; + t3 = g_strdup(escape_quotes(arg3)); + t4 = arg4 ? g_strdup(escape_quotes(arg4)) : g_malloc0(1); + buf = g_strdup_printf("'%lu','%d','%s','%s'", (unsigned long)arg1, (int)arg2, t3, t4); + g_free(t3); + g_free(t4); + } + break; + case event_chat_send_invite: + { + char *t3, *t4; + t3 = g_strdup(escape_quotes(arg3)); + t4 = *(char **)arg4 ? g_strdup(escape_quotes(*(char **)arg4)) : g_malloc0(1); + buf = g_strdup_printf("'%lu','%d','%s','%s'", (unsigned long)arg1, (int)arg2, t3, t4); + g_free(t3); + g_free(t4); + } + break; + case event_chat_send: + buf = g_strdup_printf("'%lu','%d','%s'", (unsigned long)arg1, (int)arg2, + *(char **)arg3 ? escape_quotes(*(char **)arg3) : ""); + break; + case event_warned: + buf = g_strdup_printf("'%lu','%s','%d'", (unsigned long)arg1, + arg2 ? escape_quotes(arg2) : "", (int)arg3); + break; + case event_quit: + buf = g_malloc0(1); + break; + case event_new_conversation: + buf = g_strdup_printf("'%s'", escape_quotes(arg1)); + break; + case event_im_displayed_sent: + { + char *tmp2, *tmp3; + tmp2 = g_strdup(escape_quotes(arg2)); + tmp3 = *(char **)arg3 ? g_strdup(escape_quotes(*(char **)arg3)) : g_malloc0(1); + buf = g_strdup_printf("'%lu','%s','%s'", (unsigned long)arg1, tmp2, tmp3); + g_free(tmp2); + g_free(tmp3); + } + break; + case event_im_displayed_rcvd: + { + char *tmp2, *tmp3; + tmp2 = g_strdup(escape_quotes(arg2)); + tmp3 = arg3 ? g_strdup(escape_quotes(arg3)) : g_malloc0(1); + buf = g_strdup_printf("%lu \"%s\" %s", (unsigned long)arg1, tmp2, tmp3); + g_free(tmp2); + g_free(tmp3); + } + break; + default: + return 0; + } + for (handler = perl_event_handlers; handler != NULL; handler = handler->next) { data = handler->data; - if (!strcmp(event, data->event_type)) { - handler_return = execute_perl(data->handler_name, args); - if (SvIV(handler_return)) + if (!strcmp(event_name(event), data->event_type)) { + handler_return = execute_perl(data->handler_name, buf); + if (SvIV(handler_return)) { + if (buf) + g_free(buf); return SvIV(handler_return); + } } } + + if (buf) + g_free(buf); return 0; } |
From: Eric W. <war...@us...> - 2001-10-15 19:52:47
|
Update of /cvsroot/gaim/gaim/plugins In directory usw-pr-cvs1:/tmp/cvs-serv5281/plugins Modified Files: PERL-HOWTO gaim.pl Log Message: malsyned's patch for args in perl. Index: PERL-HOWTO =================================================================== RCS file: /cvsroot/gaim/gaim/plugins/PERL-HOWTO,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PERL-HOWTO 2001/09/24 19:32:57 1.10 +++ PERL-HOWTO 2001/10/15 19:52:44 1.11 @@ -122,10 +122,11 @@ (a string with the same name as the events for plugins, see SIGNALS), and a string with the name of the function you want called. Simple enough? - When this is triggered, the arguments will be passed in @_ and are not - broken into a list, but left as one long string. You'll have to parse those - yourself with split. (Sounding exactly like X-Chat yet?) The arguments are - the exact same as those passed to the plugins, and are passed after the + When this is triggered, the arguments will be passed in @_ and are broken + into a list. This is different from all previous versions of Gaim, where you + had to parse the arguments yourself. The arguments are quite different from + what's passed to the plugins, though they are very similar, and you should + read perl.c to figure out what they are. The arguments are passed after the plugins have had their way with them. Perl scripts cannot modify the values so that gaim knows what the changes are. @@ -134,10 +135,6 @@ event simply return a non-0 value. This will cause all subsequent scripts and the event itself to never happen (i.e. the user won't see it happen, and _send events won't actually send). - - Names of buddies and chat rooms will be in quotes, and all other - values (like text messages) will not be. (Watch the debug window to get a - better feel for this, or better yet, look at the bottom of plugins.c.) GAIM::add_timeout_handler(integer, function) This calls function after integer number of seconds. It only calls function Index: gaim.pl =================================================================== RCS file: /cvsroot/gaim/gaim/plugins/gaim.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gaim.pl 2001/09/24 19:32:57 1.3 +++ gaim.pl 2001/10/15 19:52:44 1.4 @@ -18,9 +18,9 @@ GAIM::add_timeout_handler(60, "notify"); sub echo_reply { - $args = $_[0]; - $args =~ s/(.+) \"(.+)\"//; - GAIM::print_to_conv($1, $2, "Hello", 0); + $index = $_[0]; + $who = $_[1]; + GAIM::print_to_conv($index, $who, "Hello", 0); } sub notify { |
From: Eric W. <war...@us...> - 2001-10-15 19:52:47
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv5281 Modified Files: ChangeLog Log Message: malsyned's patch for args in perl. Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.316 retrieving revision 1.317 diff -u -d -r1.316 -r1.317 --- ChangeLog 2001/10/14 03:54:39 1.316 +++ ChangeLog 2001/10/15 19:52:44 1.317 @@ -10,6 +10,9 @@ * Ability to stop animation on buddy icons, hide certain buddy icons, and save people's buddy icons, all through a right-click menu + * Event handlers in perl passed arguments as elements of + an array rather than all concatenated as a string, making + perl much easier to use (thanks Dennis Lambe Jr.) version 0.45 (10/04/2001): * New plugin event: event_chat_send_invite |
From: Eric W. <war...@us...> - 2001-10-15 19:18:22
|
Update of /cvsroot/gaim/gaim/src/protocols/gg In directory usw-pr-cvs1:/tmp/cvs-serv25852 Modified Files: libgg.h Log Message: hi. Index: libgg.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/gg/libgg.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- libgg.h 2001/10/10 20:03:17 1.3 +++ libgg.h 2001/10/15 19:18:19 1.4 @@ -201,7 +201,7 @@ * je¶li chcemy sobie podebugowaæ, wystarczy zdefiniowaæ GG_DEBUG. */ -int gg_debug_level; +extern int gg_debug_level; #ifdef GG_DEBUG |