Add follow notifications for local follows too

Fixes #326
pull/317/head
Andrew Godwin 2022-12-30 10:19:26 -07:00
rodzic 7eff751224
commit 52b4384cd6
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -144,6 +144,8 @@ class Follow(StatorModel):
Creates a Follow from a local Identity to the target
(which can be local or remote).
"""
from activities.models import TimelineEvent
if not source.local:
raise ValueError("You cannot initiate follows from a remote Identity")
try:
@ -154,6 +156,7 @@ class Follow(StatorModel):
# TODO: Local follow approvals
if target.local:
follow.state = FollowStates.accepted
TimelineEvent.add_follow(follow.target, follow.source)
follow.save()
return follow