Broadcast update events for edit profile

Works on #26
This commit is contained in:
Mouse Reeve 2020-03-28 19:19:13 -07:00
parent cf113e50fe
commit cf06b40c08
2 changed files with 10 additions and 0 deletions

View file

@ -298,3 +298,11 @@ def handle_update_book(user, book):
recipients = get_recipients(None, 'public') recipients = get_recipients(None, 'public')
broadcast(user, update_activity, recipients) broadcast(user, update_activity, recipients)
def handle_update_user(user):
''' broadcast editing a user's profile '''
actor = activitypub.get_actor(user)
update_activity = activitypub.get_update(user, actor)
recipients = get_recipients(user, 'public')
broadcast(user, update_activity, recipients)

View file

@ -83,6 +83,8 @@ def edit_profile(request):
request.user.manually_approves_followers = \ request.user.manually_approves_followers = \
form.cleaned_data['manually_approves_followers'] form.cleaned_data['manually_approves_followers']
request.user.save() request.user.save()
outgoing.handle_update_user(request.user)
return redirect('/user/%s' % request.user.localname) return redirect('/user/%s' % request.user.localname)