diff src/buddy.c @ 1235:a9cf2f61a7b1

[gaim-migrate @ 1245] 1. added protocol names to menus in conversation/join chat dialog. helpful if you're signed on as warmenhoven in both irc and yahoo. 2. made "no sounds when away" mean absolutely no sounds when away. 3. fixed buddy pounces and made it so you can save them. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 12 Dec 2000 09:09:24 +0000
parents 728a90516211
children 8cb5c1000ea9
line wrap: on
line diff
--- a/src/buddy.c	Mon Dec 11 13:06:03 2000 +0000
+++ b/src/buddy.c	Tue Dec 12 09:09:24 2000 +0000
@@ -1295,7 +1295,7 @@
 	save_prefs();
 }
 
-void do_pounce(char *name)
+void do_pounce(char *name, int when)
 {
         char *who;
         
@@ -1311,6 +1311,8 @@
 		b = (struct buddy_pounce *)bp->data;
 		bp = bp->next; /* increment the list here because rem_bp can make our handle bad */
 
+		if (!(b->options & when)) continue;
+
 		u = find_user(b->pouncer, b->protocol); /* find our user */
 		if (u == NULL) continue;
 
@@ -1318,13 +1320,13 @@
 		if (u->gc == NULL) continue;
 		
                 if (!strcasecmp(who, normalize(b->name))) { /* find someone to pounce */
-			if (b->popup == 1)
+			if (b->options & OPT_POUNCE_POPUP)
 			{
 				c = find_conversation(name);
 				if (c == NULL)
 					c = new_conversation(name);
 			}
-			if (b->sendim == 1)
+			if (b->options & OPT_POUNCE_SEND_IM)
 			{
                         	c = find_conversation(name);
                         	if (c == NULL)
@@ -1333,7 +1335,7 @@
                         	write_to_conv(c, b->message, WFLAG_SEND, NULL);
                                 serv_send_im(u->gc, name, b->message, 0);
 			}
-			if (b->cmd == 1)
+			if (b->options & OPT_POUNCE_COMMAND)
 			{
 				int pid = fork();
 
@@ -1350,7 +1352,8 @@
 				}
 			}
                         
-                        rem_bp(NULL, b);
+			if (!(b->options & OPT_POUNCE_SAVE))
+				rem_bp(NULL, b);
                         
                 }
         }