prevent traceback in trigger plugin.
This commit is contained in:
parent
b7316cc206
commit
93683a8c54
|
@ -1,7 +1,7 @@
|
||||||
[info]
|
[info]
|
||||||
name: Triggers
|
name: Triggers
|
||||||
short_name: triggers
|
short_name: triggers
|
||||||
version: 0.0.2
|
version: 0.0.3
|
||||||
description: Configure Gajim's behaviour for each contact
|
description: Configure Gajim's behaviour for each contact
|
||||||
authors: Yann Leboulanger <asterix@lagaule.org>
|
authors: Yann Leboulanger <asterix@lagaule.org>
|
||||||
homepage: http://trac.gajim.org/wiki/
|
homepage: http://trac.gajim.org/wiki/
|
||||||
|
|
|
@ -48,8 +48,10 @@ class Triggers(GajimPlugin):
|
||||||
if rule['recipient_type'] == 'contact' and obj.jid not in \
|
if rule['recipient_type'] == 'contact' and obj.jid not in \
|
||||||
rule_recipients:
|
rule_recipients:
|
||||||
return False
|
return False
|
||||||
contact_groups = gajim.contacts.get_first_contact_from_jid(
|
contact = gajim.contacts.get_first_contact_from_jid(obj.conn.name, obj.jid)
|
||||||
obj.conn.name, obj.jid).groups
|
if not contact: # PM?
|
||||||
|
return False
|
||||||
|
contact_groups = contact.groups
|
||||||
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:
|
||||||
|
|
Loading…
Reference in New Issue