[triggers] Fix checking groups
This commit is contained in:
@@ -19,11 +19,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Optional
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from dataclasses import dataclass
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from gajim.common import app
|
from gajim.common import app
|
||||||
@@ -196,6 +194,9 @@ class Triggers(GajimPlugin):
|
|||||||
client = app.get_client(event.account)
|
client = app.get_client(event.account)
|
||||||
contact = client.get_module('Contacts').get_contact(event.jid)
|
contact = client.get_module('Contacts').get_contact(event.jid)
|
||||||
|
|
||||||
|
if contact.is_groupchat or not contact.is_in_roster:
|
||||||
|
return False
|
||||||
|
|
||||||
group_found = False
|
group_found = False
|
||||||
for group in contact.groups:
|
for group in contact.groups:
|
||||||
if group in rule_recipients:
|
if group in rule_recipients:
|
||||||
|
|||||||
Reference in New Issue
Block a user