# HG changeset patch # User Matti Hamalainen # Date 1214036169 -10800 # Node ID ccf302dae89816eafe8b333b4358ed226328bc43 # Parent 29098addfa65d7349a68fe1153b0479a398d5bda Add decoding of entities. diff -r 29098addfa65 -r ccf302dae898 nnchat.c --- a/nnchat.c Thu Jun 12 23:55:41 2008 +0300 +++ b/nnchat.c Sat Jun 21 11:16:09 2008 +0300 @@ -477,7 +477,7 @@ int handleUser(int sock, char *str) { const char *msg = ""; - char *p = str, *q, *s; + char *p = str, *q, *s, *t, *h; (void) sock; @@ -499,21 +499,24 @@ return -2; } - /* FIXME: decodeStr2() */ if (*s == '/') { - char *t; if (!strncmp(s, "/BPRV", 5)) { t = stripTags(s + 2); - printMsg("%s\n", t); + h = decodeStr2(t); + printMsg("%s\n", h); } else { t = stripTags(s + 1); - printMsg("* %s\n", t); + h = decodeStr2(t); + printMsg("* %s\n", h); } + th_free(h); th_free(t); } else { - char *t = stripTags(s); - printMsg("<%s> %s\n", p, t); + t = stripTags(s); + h = decodeStr2(t); + printMsg("<%s> %s\n", p, h); + th_free(h); th_free(t); } @@ -654,8 +657,8 @@ return -1; } else { /* Send double-encoded */ - printf("ENC>%s\n", buf); - fflush(stdout); + //printf("ENC>%s\n", buf); + //fflush(stdout); tmpStr = encodeStr2(buf); if (!tmpStr) return -2;