Ok, hopefully I’ve done that correctly - let me know if not!
https://github.com/discourse/discourse/pull/4509