The account name check would work fine, as long as it's setting that sender account as soon as you open the message window. Otherwise it would be checking the account name of the ID after the other person logged off.
Like:
PlayerA opens PM to PlayerB
PlayerA is typing message
PlayerB signs off
New PlayerB takes their place
PlayerA sends message
Message checks the account of PlayerB
PlayerB account matches and sends message
That would be the bad way to do it, the easiest way, would be to just check PlayerB as soon as PlayerA opens the PM to start typing.
I don't see why the account check wouldn't be sufficient. There should also be an option to sort the playerlist by accountname, like on RC.