changeset 4658:22215f5129b2

[gaim-migrate @ 4969] Bill Tompkins, a gaim-e developer pointed out that my changes to the perl code were causing short-circuited events from C scripts to not be short-circuited. This caused gaim-e to show messages it shouldn't have. This patch should fix that. Bill, or any other gaim-e or even any other perl script or c plugin user, let me know if this fixes or doesn't fix the problem. Thanks! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 07 Mar 2003 05:20:39 +0000
parents 745f583372cd
children 260678c4aeb3
files src/perl.c
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/perl.c	Fri Mar 07 04:08:35 2003 +0000
+++ b/src/perl.c	Fri Mar 07 05:20:39 2003 +0000
@@ -937,16 +937,18 @@
 				((struct gaim_connection *)arg1)->away : tmpbuf2;
 		break;
 	case event_im_recv:
+		if (!*(char**)arg2 || !*(char**)arg3) return 1;
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);
 		buf[0] = tmpbuf1;
-		buf[1] = *(char **)arg2 ? *(char **)arg2 : tmpbuf3;
-		buf[2] = *(char **)arg3 ? *(char **)arg3 : tmpbuf3;
+		buf[1] = *(char **)arg2;
+		buf[2] = *(char **)arg3;
 		break;
 	case event_im_send:
+		if (!*(char**)arg3) return 1;
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);
 		buf[0] = tmpbuf1;
 		buf[1] = arg2 ? arg2 : tmpbuf3;
-		buf[2] = *(char **)arg3 ? *(char **)arg3 : tmpbuf3;
+		buf[2] = *(char **)arg3;
 		break;
 	case event_buddy_signon:
 	case event_buddy_signoff:
@@ -983,27 +985,30 @@
 		buf[1] = tmpbuf2;
 		break;
 	case event_chat_recv:
+		if (!*(char**)arg3 || !*(char**)arg4) return 1;
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);
 		buf[0] = tmpbuf1;
 		g_snprintf(tmpbuf2, 16, "%d", (int)arg2);
 		buf[1] = tmpbuf2;
 		buf[2] = *(char **)arg3;
-		buf[3] = *(char **)arg4 ? *(char **)arg4 : tmpbuf3;
+		buf[3] = *(char **)arg4;
 		break;
 	case event_chat_send_invite:
+		if (!*(char**)arg4) return 1;
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);
 		buf[0] = tmpbuf1;
 		g_snprintf(tmpbuf2, 16, "%d", (int)arg2);
 		buf[1] = tmpbuf2;
 		buf[2] = arg3;
-		buf[3] = *(char **)arg4 ? *(char **)arg4 : tmpbuf3;
+		buf[3] = *(char **)arg4;
 		break;
 	case event_chat_send:
+		if (!*(char**)arg3) return 1;
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);
 		buf[0] = tmpbuf1;
 		g_snprintf(tmpbuf2, 16, "%d", (int)arg2);
 		buf[1] = tmpbuf2;
-		buf[2] = *(char **)arg3 ? *(char **)arg3 : tmpbuf3;
+		buf[2] = *(char **)arg3;
 		break;
 	case event_warned:
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);
@@ -1021,10 +1026,11 @@
 		buf[0] = arg1;
 		break;
 	case event_im_displayed_sent:
+		if (!*(char**)arg3) return 1;
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);
 		buf[0] = tmpbuf1;
 		buf[1] = arg2;
-		buf[2] = *(char **)arg3 ? *(char **)arg3 : tmpbuf3;
+		buf[2] = *(char **)arg3;
 		break;
 	case event_im_displayed_rcvd:
 		g_snprintf(tmpbuf1, 16, "%lu", (unsigned long)arg1);