Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/common/modules/muc.py
    ... ... @@ -984,10 +984,15 @@ def invite(self,
    984 984
                    reason: Optional[str] = None,
    
    985 985
                    continue_: bool = False
    
    986 986
                    ) -> str:
    
    987
    -        if helpers.get_muc_context(room) == 'private':
    
    988
    -            room_contact = self._get_contact(room)
    
    989
    -            assert isinstance(room_contact, GroupchatContact)
    
    987
    +
    
    988
    +        room_contact = self._get_contact(room, groupchat=True)
    
    989
    +        assert isinstance(room_contact, GroupchatContact)
    
    990
    +        disco = room_contact.get_disco()
    
    991
    +        assert disco is not None
    
    992
    +
    
    993
    +        if disco.muc_is_members_only:
    
    990 994
                 self_contact = room_contact.get_self()
    
    995
    +            assert self_contact is not None
    
    991 996
                 affiliation = self_contact.affiliation
    
    992 997
                 admin = affiliation.is_owner or affiliation.is_admin
    
    993 998
                 if admin: