forked from MarseyWorld/MarseyWorld
prevent repeated mentions when the mentioner changes their name
parent
fa222922b9
commit
16cf545aa0
|
@ -126,6 +126,10 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None, followers_pi
|
||||||
return set()
|
return set()
|
||||||
|
|
||||||
text = text.lower()
|
text = text.lower()
|
||||||
|
|
||||||
|
if oldtext:
|
||||||
|
oldtext = oldtext.lower()
|
||||||
|
|
||||||
notify_users = set()
|
notify_users = set()
|
||||||
|
|
||||||
for word, id in NOTIFIED_USERS.items():
|
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))
|
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)
|
user_ids = get_users(names, ids_only=True, graceful=True)
|
||||||
notify_users.update(user_ids)
|
notify_users.update(user_ids)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue