diff src/buddy.c @ 2550:01dad6d8ba5b

[gaim-migrate @ 2563] New buddy pounce action: popup notification window. Thanks for the suggestion, Allan Third. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 19 Oct 2001 18:44:52 +0000
parents dd4114ed4c07
children 83f914362d72
line wrap: on
line diff
--- a/src/buddy.c	Fri Oct 19 09:58:39 2001 +0000
+++ b/src/buddy.c	Fri Oct 19 18:44:52 2001 +0000
@@ -1451,6 +1451,19 @@
 
 				set_convo_gc(c, u->gc);
 			}
+			if (b->options & OPT_POUNCE_NOTIFY) {
+				char tmp[1024];
+
+				/* I know the line below is really ugly. I only did it this way
+				 * because I thought it'd be funny :-) */
+
+				g_snprintf(tmp, sizeof(tmp), "%s has %s", name, 
+					(b->options & OPT_POUNCE_SIGNON) ? "signed on" : 
+					(b->options & OPT_POUNCE_UNIDLE) ? "returned from being idle" : 
+					"returned from being away");
+
+				do_error_dialog(tmp, _("Buddy Pounce"));
+			}
 			if (b->options & OPT_POUNCE_SEND_IM) {
 				c = find_conversation(name);
 				if (c == NULL)
@@ -1458,8 +1471,10 @@
 
 				set_convo_gc(c, u->gc);
 
-				write_to_conv(c, b->message, WFLAG_SEND, NULL, time((time_t) NULL));
-				serv_send_im(u->gc, name, b->message, 0);
+				if (strlen(b->message) > 0) {
+					write_to_conv(c, b->message, WFLAG_SEND, NULL, time((time_t) NULL));
+					serv_send_im(u->gc, name, b->message, 0);
+				}
 			}
 			if (b->options & OPT_POUNCE_COMMAND) {
 				int pid = fork();