I think you have to take a step back and instead of being up-set over what happened, ask yourself why it happened.
It is also correct for him not to go into details, as if true, nothing happened, what is the point of letting your mind see all - of - nothing.
Then you'll conjure up other thoughts, whilst at the moment the only thoughts you can produce are the mobile phone messages.
Take a step back to that time, if he even contemplated, then something was amiss and he was not feeling happy, probably neither were you.
The fact that he did not take it further and came back, in my opinion means that the bond you both had/have is worth working on.
So that to me means, working on the issue that was there at the time.
It is easy to feel un-wanted, un-loved, and find attraction from someone whom shows it, even in a flirting way, to make yourself feel better within yourself.
It's the not doing that is special..
See it from that point and see what you can visualise from that particular time first.