If you're worried, ask him. If he says it's cool, go ahead, but watch HOW you text. No flirting, cuz if she thinks you're flirting, she'll naturally get peeved.
If you're REALLY worried, ask him, and if he says it's ok, ask him if he asked HER. and make sure he got her okay.