server: fixed bug in has_badge()