Updated code to emit latest messages to current user.