Join group logic

This just does the logic around showing the 'join group' or 'ask to join group' button.