My friend won't stop flirting..

So I'm good friends with this guy, we're both in relationships but he's not very happy in his while I am. We're in lectures together and he just continuously flirts, he texts me all the time and jokes about us having sex and loving me. His girlfriend is lovely but doesn't treat him very well, and I want to speak to her about it all but I feel like it's not my place and I would do more bad than good.. I put him in his place all the time and he knows how happy I am with my boyfriend, what should I do? Is he actually in love with me?