rewrite: chat & leave-group bug fixes