mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
tweaks follow handling
This commit is contained in:
parent
43c6b9880a
commit
b32fce25d9
2 changed files with 4 additions and 6 deletions
|
@ -134,10 +134,8 @@ def handle_follow(activity):
|
|||
except django.db.utils.IntegrityError as err:
|
||||
if err.__cause__.diag.constraint_name != 'userfollowrequest_unique':
|
||||
raise
|
||||
# Duplicate follow request. Not sure what the correct behaviour is, but
|
||||
# just dropping it works for now. We should perhaps generate the
|
||||
# Accept, but then do we need to match the activity id?
|
||||
return
|
||||
relationship = models.UserFollowRequest.objects.get(remote_id=activity['id'])
|
||||
# send the accept normally for a duplicate request
|
||||
|
||||
if not to_follow.manually_approves_followers:
|
||||
status_builder.create_notification(
|
||||
|
|
|
@ -66,7 +66,7 @@ def handle_follow(user, to_follow):
|
|||
user_object=to_follow,
|
||||
)
|
||||
activity = relationship.to_activity()
|
||||
broadcast(user, activity, direct_recipients=[to_follow])
|
||||
broadcast(user, activity, privacy='direct', direct_recipients=[to_follow])
|
||||
|
||||
|
||||
def handle_unfollow(user, to_unfollow):
|
||||
|
@ -76,7 +76,7 @@ def handle_unfollow(user, to_unfollow):
|
|||
user_object=to_unfollow
|
||||
)
|
||||
activity = relationship.to_undo_activity(user)
|
||||
broadcast(user, activity, direct_recipients=[to_unfollow])
|
||||
broadcast(user, activity, privacy='direct', direct_recipients=[to_unfollow])
|
||||
to_unfollow.followers.remove(user)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue