A command that behaves like sudo -e, that is
1. Create temporary copy of config file
2. Invoke editor, preferably not as root. Possibly ship syntax hilighting rules.
3. When editor is closed, check if there were any changes (maybe display a patch)
4. If the file is changed, attempt to load it to perform syntax validation
5. If loading failed, display the error and ask the user if they would like to continue editing (goto 2) or abort (goto 9) .
6. Copy back changes.
7. Send SIGHUP to prosody (if running)
8. Delete temporary file.
This will be tricky to implement with prosodyctl dropping root privileges pretty early (see #530) and with most setups not allowing the prosody user write access to the config file.