Backport XChat r1523