Prepare for fixing the multi-line chat bug
This changes are not tested!