Was he flirting with me or insulting me?

There’s this guy in my high school who always teases me and my crush. I find it kinda weird because he’s in a different grade and invests too much time in my crushes and I’s relationship. He came up to me in the hallway one day and asked my name and I told him and he asked if I was ( Caleb’s friend ). Caleb is a mutual friend and I said yeah. My crushes name is David and the guy was like “you’re way out of David’s league so I won’t tease you anymore”. He had a girlfriend but He was blushing when he said it but i told my friend our conversation and she said he was being kinda rude. I think she assumed the guy meant that he was saying my crush was too cute for me or something. My crush is kinda nerdy and everyone says I can do better. Was that guy insulting me or complimenting me?
Was he flirting with me or insulting me?
Post Opinion