diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index b1c8785f5..d0cb8360c 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -126,6 +126,10 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None, followers_pi return set() text = text.lower() + + if oldtext: + oldtext = oldtext.lower() + notify_users = set() for word, id in NOTIFIED_USERS.items(): @@ -134,6 +138,10 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None, followers_pi names = set(m.group(1) for m in mention_regex.finditer(text)) + if oldtext: + oldnames = set(m.group(1) for m in mention_regex.finditer(oldtext)) + names = names - oldnames + user_ids = get_users(names, ids_only=True, graceful=True) notify_users.update(user_ids)