HelpMessageHandler filter corrections

darcs-hash:20080520062733-86b55-8c84151b75f97df4df86055f148841753ba18708.gz
This commit is contained in:
David Rousselie
2008-05-20 08:27:33 +02:00
parent 3d286c3efe
commit c9f1f19aec
2 changed files with 9 additions and 4 deletions

View File

@@ -72,8 +72,13 @@ class HelpMessageHandler(Handler):
"""
Test if stanza body match the help regexp.
"""
return self.help_regexp.search(stanza.get_body()) \
or self.help_regexp.search(stanza.get_subject())
body = stanza.get_body()
subject = stanza.get_subject()
if subject and self.help_regexp.search(subject):
return subject
if body and self.help_regexp.search(body):
return body
return None
def handle(self, stanza, lang_class, data):
"""