When pressing up arrow in chat and the last message was a whisper it leaks the message. So either fully exclude whisper from the history or make it a whisper message again.
In case that did not make sense. A practical example how private messages get leaked:
/w foo bar
->foo: bar
(pressing up arrow and enter to repeate msg)
me: bar