From: Eric W. <war...@us...> - 2001-09-24 19:33:01
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv3194/src Modified Files: perl.c plugins.c prpl.c Log Message: gaim.pl works like it should now Index: perl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/perl.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- perl.c 2001/09/22 09:14:27 1.56 +++ perl.c 2001/09/24 19:32:57 1.57 @@ -60,6 +60,7 @@ #undef DEBUG #endif #include "gaim.h" +#include "prpl.h" struct perlscript { char *name; @@ -302,7 +303,6 @@ XS (XS_GAIM_get_info) { int i = 0; - unsigned int junk; dXSARGS; items = 0; @@ -325,7 +325,8 @@ break; case 2: { - struct gaim_connection *gc = (struct gaim_connection *)SvPV(ST(1), junk); + struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); + debug_printf("%lu %lu\n", connections->data, gc); if (g_slist_find(connections, gc)) XST_mIV(i++, gc->protocol); else @@ -334,15 +335,18 @@ break; case 3: { - struct gaim_connection *gc = (struct gaim_connection *)SvPV(ST(1), junk); + struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); + debug_printf("%lu %lu\n", connections->data, gc); if (g_slist_find(connections, gc)) XST_mPV(i++, gc->username); else XST_mPV(i++, ""); } + break; case 4: { - struct gaim_connection *gc = (struct gaim_connection *)SvPV(ST(1), junk); + struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); + debug_printf("%lu %lu\n", connections->data, gc); if (g_slist_find(connections, gc)) XST_mIV(i++, g_list_index(aim_users, gc->user)); else @@ -369,6 +373,16 @@ } } break; + case 7: + { + struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); + debug_printf("%lu %lu\n", connections->data, gc); + if (g_slist_find(connections, gc)) + XST_mPV(i++, (*gc->prpl->name)()); + else + XST_mPV(i++, "Unknown"); + } + break; default: XST_mPV(0, "Error2"); i = 1; @@ -482,7 +496,6 @@ while (c) { gc = (struct gaim_connection *)c->data; serv_set_idle(gc, SvIV(ST(1))); - gc->is_idle = 1; c = c->next; } } else if (!strncasecmp(command, "warn", 4)) { @@ -687,7 +700,8 @@ items = 0; handler = g_new0(struct _perl_timeout_handlers, 1); - timeout = 1000 * atol(SvPV(ST(0), junk)); + timeout = 1000 * SvIV(ST(0)); + debug_printf("Adding timeout for %d seconds.\n", timeout/1000); handler->handler_name = g_strdup(SvPV(ST(1), junk)); perl_timeout_handlers = g_list_append(perl_timeout_handlers, handler); handler->iotag = gtk_timeout_add(timeout, (GtkFunction)perl_timeout, handler); Index: plugins.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/plugins.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- plugins.c 2001/09/22 09:14:27 1.78 +++ plugins.c 2001/09/24 19:32:57 1.79 @@ -831,15 +831,15 @@ case event_signoff: case event_away: case event_back: - g_snprintf(buf, sizeof buf, "%p", arg1); + g_snprintf(buf, sizeof buf, "%lu", (unsigned long)arg1); break; case event_im_recv: - g_snprintf(buf, sizeof buf, "%p \"%s\" %s", arg1, + 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, "%p \"%s\" %s", arg1, + g_snprintf(buf, sizeof buf, "%lu \"%s\" %s", (unsigned long)arg1, (char *)arg2, *(char **)arg3 ? *(char **)arg3 : "(null)"); break; case event_buddy_signon: @@ -849,31 +849,33 @@ case event_buddy_back: case event_buddy_idle: case event_buddy_unidle: - g_snprintf(buf, sizeof buf, "%p \"%s\"", arg1, (char *)arg2); + g_snprintf(buf, sizeof buf, "%lu \"%s\"", (unsigned long)arg1, (char *)arg2); break; case event_chat_invited: - g_snprintf(buf, sizeof buf, "%p \"%s\" \"%s\" %s", arg1, + 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, "%p %d \"%s\"", arg1, (int)arg2, (char *)arg3); + 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, "%p %d", arg1, (int)arg2); + g_snprintf(buf, sizeof buf, "%lu %d", (unsigned long)arg1, (int)arg2); break; case event_chat_recv: case event_chat_send_invite: - g_snprintf(buf, sizeof buf, "%p %d \"%s\" %s", arg1, + g_snprintf(buf, sizeof buf, "%lu %d \"%s\" %s", (unsigned long)arg1, (int)arg2, (char *)arg3, (char *)arg4); break; case event_chat_send: - g_snprintf(buf, sizeof buf, "%p %d %s", arg1, (int)arg2, + 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, "%p \"%s\" %d", arg1, arg2 ? (char *)arg2 : "", (int)arg3); + g_snprintf(buf, sizeof buf, "%lu \"%s\" %d", (unsigned long)arg1, + arg2 ? (char *)arg2 : "", (int)arg3); break; case event_quit: buf[0] = 0; @@ -882,11 +884,11 @@ g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg1); break; case event_im_displayed_sent: - g_snprintf(buf, sizeof buf, "%p \"%s\" %s", arg1, + 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, "%p \"%s\" %s", arg1, + g_snprintf(buf, sizeof buf, "%lu \"%s\" %s", (unsigned long)arg1, (char *)arg2, (char *)arg3 ? (char *)arg3 : "(null)"); break; default: Index: prpl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- prpl.c 2001/09/15 19:32:51 1.32 +++ prpl.c 2001/09/24 19:32:57 1.33 @@ -376,6 +376,7 @@ gtk_widget_show(gc->email_label); close = picture_button(gc->email_win, _("Close"), cancel_xpm); + gtk_window_set_focus(GTK_WINDOW(gc->email_win), close); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(gc->email_win)->action_area), close, 0, 0, 5); gtk_signal_connect(GTK_OBJECT(close), "clicked", @@ -405,6 +406,7 @@ gtk_widget_show(gc->email_label); close = picture_button(gc->email_win, _("Close"), cancel_xpm); + gtk_window_set_focus(GTK_WINDOW(gc->email_win), close); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(gc->email_win)->action_area), close, 0, 0, 5); gtk_signal_connect(GTK_OBJECT(close), "clicked", |