comparison nnchat.c @ 293:ff39ebf05b40 dev-0_9_0

Fix unwindowed PRVs.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 11 Jun 2011 03:39:22 +0300
parents cc2a1d837e7b
children d34910f1b1e1
comparison
equal deleted inserted replaced
292:90dd26f5918a 293:ff39ebf05b40
618 if (!optDebug && (strstr(s, "left the room") || strstr(s, "joined the room from"))) 618 if (!optDebug && (strstr(s, "left the room") || strstr(s, "joined the room from")))
619 goto done; 619 goto done;
620 620
621 t = nn_strip_tags(s + 1); 621 t = nn_strip_tags(s + 1);
622 if (!strncmp(t, "BPRV ", 5)) { 622 if (!strncmp(t, "BPRV ", 5)) {
623 char *name, *tmp, *msg; 623 char *name, *tmp, *msg, *h;
624 nn_window_t *win;
625 h = nn_decode_str2(t + 1);
624 626
625 if (!strncmp(t, "BPRV from ", 10)) { 627 if (!strncmp(t, "BPRV from ", 10)) {
626 name = nn_decode_str2(t + 10); 628 name = nn_decode_str2(t + 10);
627 isMine = FALSE; 629 isMine = FALSE;
628 } else { 630 } else {
636 else 638 else
637 msg = ""; 639 msg = "";
638 *tmp = 0; 640 *tmp = 0;
639 641
640 isIgnored = setIgnoreMode && checkIgnoreList(name); 642 isIgnored = setIgnoreMode && checkIgnoreList(name);
641 643 win = nn_find_window(name);
642 printMsgQ(nn_find_window(name), isIgnored, "½5½<½%d½%s½5½>½0½ %s\n", isMine ? 14 : 15, isMine ? optUserName : name, msg); 644
645 if (win != NULL)
646 printMsgQ(win, isIgnored, "½5½<½%d½%s½5½>½0½ %s\n", isMine ? 14 : 15, isMine ? optUserName : name, msg);
647 else
648 printMsgQ(NULL, isIgnored, "½11½%s½0½\n", h);
649
650 th_free(h);
643 } else { 651 } else {
644 /* It's an action (/me) */ 652 /* It's an action (/me) */
645 char *h = nn_decode_str2(t); 653 char *h = nn_decode_str2(t);
646 printMsgQ(NULL, isIgnored, "½9½* %s½0½\n", h); 654 printMsgQ(NULL, isIgnored, "½9½* %s½0½\n", h);
647 th_free(h); 655 th_free(h);