Babble: Admins can't see a group set to `group owner` only visibility

Ok, so I have dived into this issue a little deeper.

It seems like babble had assigned its own visibility_level for its own use, and took the next unused constant (4).

A few weeks ago, the Discourse core code added a new visiblity_level as well, and took the next unused constant, which was 4 as well. This caused a duplicate use of this constant.

So a fix would consist of two parts:

  • change the visibility_level used by babble. That would be easy. If we wanted to do this really neatly we would have each plugin register its own BASE_VISIBILITY_LEVEL in order to avoid future clashes. But for now we could just pick something (for instance 1001).
  • change the groups with visibility_level 4 to the new constant - but only the groups that were used by babble.
    Would this query select the right groups @gdpelican ?
UPDATE groups 
SET visibility_level = 1001 
WHERE id IN (
  SELECT g.id 
  FROM topics t 
  LEFT JOIN topic_allowed_groups tag ON tag.topic_id = t.id 
  LEFT JOIN groups g ON g.id = tag.group_id 
  WHERE t.archetype='chat');`