Not feeling right about it, what to do?

So this girl is in love with a friend of mine, and he's also in love with her, but they don't have a relationship because the boy doesn't want to but he still flirts with her and she's quite desperate so she stays with him. However The boy doesn't like when she talks to with me and then he gets jealous and the he gets mad at her, if he gets mad at her, she directly says sorry.
She's very close with me, we're just friends, and when he's not in our lesson , she and I sit next to each other and we talk about all kinds of stuff and we have a lot of fun together and she also trust me so she tells me a lot of personal stuff as well. But when he's around or any of his friends she acts like she doesn't even know me and when he disapears she directly talks to me. I really like talking with her and having fun with her. But I don't like this kind of friendship with her. What should I do now?
Not feeling right about it, what to do?
Add Opinion