diff src/buddy.c @ 1155:f4d4a14752ee

[gaim-migrate @ 1165] Heres the rest of the BP crap. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Tue, 28 Nov 2000 10:20:23 +0000
parents aa3dda7fc352
children 27c528068f28
line wrap: on
line diff
--- a/src/buddy.c	Tue Nov 28 05:57:56 2000 +0000
+++ b/src/buddy.c	Tue Nov 28 10:20:23 2000 +0000
@@ -1304,17 +1304,24 @@
         
         struct buddy_pounce *b;
 	struct conversation *c;
+	struct aim_user *u;
 
 	GList *bp = buddy_pounces;
         
 	who = g_strdup(normalize(name));
 
-	/* FIXME: we should decide somewhere who we're pouncing as */
 	while(bp) {
-		b = (struct buddy_pounce *)bp->data;;
+		b = (struct buddy_pounce *)bp->data;
 		bp = bp->next; /* increment the list here because rem_bp can make our handle bad */
 
-                if (!strcasecmp(who, normalize(b->name))) {
+		u = find_user(b->pouncer, b->protocol); /* find our user */
+		if (u == NULL) continue;
+
+                if (!strcasecmp(who, normalize(b->name))) { /* find someone to pounce */
+			/* check and see if we're signed on as the pouncer */
+
+			if (u->gc == NULL) continue;
+			
 			if (b->popup == 1)
 			{
 				c = find_conversation(name);
@@ -1328,8 +1335,7 @@
                                 	c = new_conversation(name);
 
                         	write_to_conv(c, b->message, WFLAG_SEND, NULL);
-
-                                serv_send_im(c->gc, name, b->message, 0);
+                                serv_send_im(u->gc, name, b->message, 0);
 			}
                         
                         rem_bp(NULL, b);