@miconda Hi Daniel, just confirming this is cleaned up now and ready for whenever you have a chance to look at it - but let me know if you suggest any other changes. The only thing I haven't done is move the `pv_parse_format` into the fixup function, because as per the notes in my PR I had some weird segfaults there. But I can work on this if needed.
Otherwise, I've left the PR split into two commits in-case you're against sharing the matching logic for the dlg.match RPC command and this new dlg_add_matches, though I am happy with how things ended up with the shared function.
Thanks! Rhys.