remotes/1693045480750635534/spooky-22
Aevann1 2021-11-04 18:44:34 +02:00
parent e932714188
commit dd70a0aa03
1 changed files with 13 additions and 0 deletions

View File

@ -201,6 +201,19 @@ def settings_profile_post(v):
v=v,
error="Your top 8 friends list is too long")
notify_users = set()
soup = BeautifulSoup(friends_html, features="html.parser")
for mention in soup.find_all("a", href=re.compile("^/@(\w+)")):
username = mention["href"].split("@")[1]
user = g.db.query(User).options(lazyload('*')).filter_by(username=username).first()
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
if request.host == 'rdrama.net' and 'aevann' in friends_html.lower() and 1 not in notify_users: notify_users.add(1)
for x in notify_users: send_notification(x, f"@{v.username} has added you to their top 8 friends!")
v.friends = friends[:500]
v.friends_html=friends_html
g.db.add(v)