comparison nnchat.c @ 188:6b399b7ce40b

Automatically grab PRV target from incoming PRV if target not already set.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 16 Nov 2010 02:40:17 +0200
parents c73003485c2d
children b0d64dde62af
comparison
equal deleted inserted replaced
187:c73003485c2d 188:6b399b7ce40b
391 goto error; 391 goto error;
392 392
393 t = nn_strip_tags(s + 1); 393 t = nn_strip_tags(s + 1);
394 if (!strncmp(t, "BPRV", 4)) { 394 if (!strncmp(t, "BPRV", 4)) {
395 h = nn_decode_str2(t + 1); 395 h = nn_decode_str2(t + 1);
396 if (setTarget == NULL && !strncmp(h, "PRV from ", 9)) {
397 char *end, *name = th_strdup(h + 9);
398 if (name != NULL && (end = strchr(name, ':')) != NULL) {
399 *end = 0;
400 setTarget = th_strdup(name);
401 printMsg("PRV target autoset to '%s'\n", setTarget);
402 }
403 th_free(name);
404 }
396 printMsg("½11½%s½0½\n", h); 405 printMsg("½11½%s½0½\n", h);
397 } else { 406 } else {
398 h = nn_decode_str2(t); 407 h = nn_decode_str2(t);
399 printMsg("½9½* %s½0½\n", h); 408 printMsg("½9½* %s½0½\n", h);
400 } 409 }