diff options
author | lovetox <philipp@hoerist.com> | 2022-09-02 23:23:58 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-09-02 23:23:58 +0300 |
commit | c74d8f0e2c916dc7117c65e097569de003053d9d (patch) | |
tree | 42bb3ac1985880887f821adef9b22e128697bed6 | |
parent | 857f654cd9fe6cbd9a0b374a277a62a7b85def28 (diff) |
fix: MUC: Improve automatically adding members on invite
Gajims private definition of a group chat means also it must be non-anonymous.
This make not much sense for the invite logic, here it should only matter
if the room is members-only or not.
-rw-r--r-- | gajim/common/modules/muc.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gajim/common/modules/muc.py b/gajim/common/modules/muc.py index 284751910..940528de3 100644 --- a/gajim/common/modules/muc.py +++ b/gajim/common/modules/muc.py @@ -984,10 +984,15 @@ class MUC(BaseModule): reason: Optional[str] = None, continue_: bool = False ) -> str: - if helpers.get_muc_context(room) == 'private': - room_contact = self._get_contact(room) - assert isinstance(room_contact, GroupchatContact) + + room_contact = self._get_contact(room, groupchat=True) + assert isinstance(room_contact, GroupchatContact) + disco = room_contact.get_disco() + assert disco is not None + + if disco.muc_is_members_only: self_contact = room_contact.get_self() + assert self_contact is not None affiliation = self_contact.affiliation admin = affiliation.is_owner or affiliation.is_admin if admin: |