# HG changeset patch # User Matti Hamalainen # Date 1289868017 -7200 # Node ID 6b399b7ce40b43c5018e0522d3ce55f3d60521fe # Parent c73003485c2df5ffd6c560a223e987841b0c1deb Automatically grab PRV target from incoming PRV if target not already set. diff -r c73003485c2d -r 6b399b7ce40b nnchat.c --- a/nnchat.c Tue Nov 16 02:39:59 2010 +0200 +++ b/nnchat.c Tue Nov 16 02:40:17 2010 +0200 @@ -393,6 +393,15 @@ t = nn_strip_tags(s + 1); if (!strncmp(t, "BPRV", 4)) { h = nn_decode_str2(t + 1); + if (setTarget == NULL && !strncmp(h, "PRV from ", 9)) { + char *end, *name = th_strdup(h + 9); + if (name != NULL && (end = strchr(name, ':')) != NULL) { + *end = 0; + setTarget = th_strdup(name); + printMsg("PRV target autoset to '%s'\n", setTarget); + } + th_free(name); + } printMsg("½11½%s½0½\n", h); } else { h = nn_decode_str2(t);