Hoist joining of message content in alert_words processor

(imported from commit 5025b7108839ddc04d6d9e575a9a288223526fe8)
This commit is contained in:
Leo Franchi 2013-09-06 15:05:14 -04:00
parent 8c0e112aa7
commit a67d461139
1 changed files with 1 additions and 1 deletions

View File

@ -582,11 +582,11 @@ class AlertWordsNotificationProcessor(markdown.preprocessors.Preprocessor):
# We check for a user's custom notifications here, as we want # We check for a user's custom notifications here, as we want
# to check for plaintext words that depend on the recipient. # to check for plaintext words that depend on the recipient.
realm_words = alert_words.alert_words_in_realm(current_message.sender.realm) realm_words = alert_words.alert_words_in_realm(current_message.sender.realm)
content = '\n'.join(lines)
for user, words in realm_words.iteritems(): for user, words in realm_words.iteritems():
for word in words: for word in words:
escaped = re.escape(word) escaped = re.escape(word)
match_re = re.compile(r'\b%s\b' % (escaped,)) match_re = re.compile(r'\b%s\b' % (escaped,))
content = '\n'.join(lines)
if re.search(match_re, content): if re.search(match_re, content):
current_message.user_ids_with_alert_words.add(user.id) current_message.user_ids_with_alert_words.add(user.id)