I wouldn't jump to that conclusion! How long have the two of you been chatting? If it's only been a week or two, don't give up right away. If it's been more like a month or more, I would just accept that he only wanted to be (flirty) friends. If this is the case, you can decide if you can just flirt with him without getting hurt, knowing a serious relationship is doubtful, or decide to spend time flirting with another, available guy.
BUT, if he's single (always be sure to check!), and the two of you have just started chatting, stay optimistic! The hug is a good sign; he's comfortable around you. I don't know the exact situation, but he could've just been in a hurry or a little shy. Another good sign is the two of you can laugh together--the best relationships are made up of couples who can laugh with each other and at themselves. So keep chatting, flirting, and see where it leads!