Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
9a591533
by Philipp Hörist at 2022-09-07T22:52:40+02:00
2 changed files:
Changes:
| ... | ... | @@ -809,18 +809,6 @@ def load_json(path: Path, |
| 809 | 809 | return json_dict.get(key, default)
|
| 810 | 810 | |
| 811 | 811 | |
| 812 | -def ignore_contact(account: str, jid: JID) -> bool:
|
|
| 813 | - client = app.get_client(account)
|
|
| 814 | - contact = client.get_module('Contacts').get_contact(jid)
|
|
| 815 | - |
|
| 816 | - ignore_unknown = app.settings.get_account_setting(
|
|
| 817 | - account, 'ignore_unknown_contacts')
|
|
| 818 | - if ignore_unknown and not contact.is_in_roster:
|
|
| 819 | - log.info('Ignore unknown contact %s', str(jid))
|
|
| 820 | - return True
|
|
| 821 | - return False
|
|
| 822 | - |
|
| 823 | - |
|
| 824 | 812 | class AdditionalDataDict(collections.UserDict):
|
| 825 | 813 | data: dict[str, Any]
|
| 826 | 814 |
| ... | ... | @@ -1025,10 +1025,10 @@ def _on_invite_or_decline(self, |
| 1025 | 1025 | _stanza: Message,
|
| 1026 | 1026 | properties: MessageProperties
|
| 1027 | 1027 | ) -> None:
|
| 1028 | + |
|
| 1028 | 1029 | if properties.muc_decline is not None:
|
| 1029 | 1030 | data = properties.muc_decline
|
| 1030 | - if helpers.ignore_contact(self._account, data.from_):
|
|
| 1031 | - raise nbxmpp.NodeProcessed
|
|
| 1031 | + contact = self._get_contact(data.muc, groupchat=True)
|
|
| 1032 | 1032 | |
| 1033 | 1033 | self._log.info('Invite declined from: %s, reason: %s',
|
| 1034 | 1034 | data.from_, data.reason)
|
| ... | ... | @@ -1040,12 +1040,10 @@ def _on_invite_or_decline(self, |
| 1040 | 1040 | |
| 1041 | 1041 | if properties.muc_invite is not None:
|
| 1042 | 1042 | data = properties.muc_invite
|
| 1043 | - if helpers.ignore_contact(self._account, data.from_):
|
|
| 1044 | - raise nbxmpp.NodeProcessed
|
|
| 1043 | + contact = self._get_contact(data.muc, groupchat=True)
|
|
| 1045 | 1044 | |
| 1046 | 1045 | self._log.info('Invite from: %s, to: %s', data.from_, data.muc)
|
| 1047 | 1046 | |
| 1048 | - contact = self._get_contact(data.muc, groupchat=True)
|
|
| 1049 | 1047 | if contact.is_joined:
|
| 1050 | 1048 | # We are already in groupchat. Ignore invitation
|
| 1051 | 1049 | self._log.info('We are already in this room')
|