codemastr:

That would work, but what if the user already had an open private message window? Then your code wouldn't log new incoming messages of an already open PM window. That's why ON TEXT is better.