# HG changeset patch # User Rob Flynn # Date 975406823 0 # Node ID f4d4a14752ee271d97b811255a5de8b73f5c74f1 # Parent 938d9cd7614889a4f09ae95c90d032d14388ea0e [gaim-migrate @ 1165] Heres the rest of the BP crap. committer: Tailor Script diff -r 938d9cd76148 -r f4d4a14752ee src/buddy.c --- 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); diff -r 938d9cd76148 -r f4d4a14752ee src/dialogs.c --- a/src/dialogs.c Tue Nov 28 05:57:56 2000 +0000 +++ b/src/dialogs.c Tue Nov 28 10:20:23 2000 +0000 @@ -1050,6 +1050,8 @@ g_snprintf(bp->message, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->messentry))); g_snprintf(bp->pouncer, 80, "%s", b->user->username); + bp->protocol = b->user->protocol; + if (GTK_TOGGLE_BUTTON(b->openwindow)->active) bp->popup = 1; else diff -r 938d9cd76148 -r f4d4a14752ee src/gaim.h --- a/src/gaim.h Tue Nov 28 05:57:56 2000 +0000 +++ b/src/gaim.h Tue Nov 28 10:20:23 2000 +0000 @@ -247,7 +247,8 @@ int sendim; char pouncer[80]; - + int protocol; + int signon; int unaway; int unidle; diff -r 938d9cd76148 -r f4d4a14752ee src/gaimrc.c --- a/src/gaimrc.c Tue Nov 28 05:57:56 2000 +0000 +++ b/src/gaimrc.c Tue Nov 28 10:20:23 2000 +0000 @@ -279,20 +279,21 @@ { b = g_new0(struct buddy_pounce, 1); - g_snprintf(b->name, sizeof(b->name), "%s", p->value[1]); - g_snprintf(b->message, sizeof(b->message), "%s", p->value[2]); - g_snprintf(b->pouncer, sizeof(b->pouncer), "%s", p->value[0]); + g_snprintf(b->name, sizeof(b->name), "%s", p->value[0]); + g_snprintf(b->message, sizeof(b->message), "%s", p->value[1]); - b->popup = atoi(p->value[3]); - b->sendim = atoi(p->value[4]); + b->popup = atoi(p->value[2]); + b->sendim = atoi(p->value[3]); /* Let's check our version and see what's going on here */ - if ((p->value[5]) && (strlen(p->value[5]) > 0)) + if ((p->value[4]) && (strlen(p->value[4]) > 0)) { /* If we have data, lets use it */ - b->signon = atoi(p->value[5]); - b->unaway = atoi(p->value[6]); - b->unidle = atoi(p->value[7]); + g_snprintf(b->pouncer, sizeof(b->pouncer), "%s", p->value[4]); + b->protocol = atoi(p->value[5]); + b->signon = atoi(p->value[6]); + b->unaway = atoi(p->value[7]); + b->unidle = atoi(p->value[8]); } else { @@ -330,7 +331,7 @@ str2[0] = 0; } - fprintf(f, "\tentry { %s } { %s } { %s } { %d } { %d } { %d } { %d } { %d }\n", b->pouncer, str1, str2, b->popup, b->sendim, b->signon, b->unaway, b->unidle); + fprintf(f, "\tentry { %s } { %s } { %d } { %d } { %s } { %d } { %d } { %d } { %d }\n", str1, str2, b->popup, b->sendim, b->pouncer, b->protocol, b->signon, b->unaway, b->unidle); /* escape_text2 uses malloc(), so we don't want to g_free these */ free(str1);