I agree with Bill frank about the personal messages. Keep your pants zipped until this is over. That includes messages, dinner, lunch, just drinks, etc.
Don't do what you accussed her of doing to you.
PLENTY of time for that later. The women are not going anywhere.
But the one woman in your life CAN and WILL use it to destroy you if she can.
And don't believe the BS that it does not count in court. Everything counts - especially character - especially in a custody fight.