prevent traceback in trigger plugin.

This commit is contained in:
Yann Leboulanger 2011-11-08 20:23:48 +01:00
parent b7316cc206
commit 93683a8c54
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,7 @@
[info]
name: Triggers
short_name: triggers
version: 0.0.2
version: 0.0.3
description: Configure Gajim's behaviour for each contact
authors: Yann Leboulanger <asterix@lagaule.org>
homepage: http://trac.gajim.org/wiki/

View File

@ -48,8 +48,10 @@ class Triggers(GajimPlugin):
if rule['recipient_type'] == 'contact' and obj.jid not in \
rule_recipients:
return False
contact_groups = gajim.contacts.get_first_contact_from_jid(
obj.conn.name, obj.jid).groups
contact = gajim.contacts.get_first_contact_from_jid(obj.conn.name, obj.jid)
if not contact: # PM?
return False
contact_groups = contact.groups
group_found = False
for group in contact_groups:
if group in rule_recipients: