I am pretty stupid when it comes to cherry-picking pull requests so this is my implementation of #383 so the ZNC part is not included.