Also for settings import - Don't send subscription activity to communities on dead instances

This commit is contained in:
freamon 2024-08-20 21:39:53 +00:00
parent 96cc0704e0
commit 1907c009b3

View file

@ -731,7 +731,11 @@ def import_settings_task(user_id, filename):
# send ActivityPub message to remote community, asking to follow. Accept message will be sent to our shared inbox # send ActivityPub message to remote community, asking to follow. Accept message will be sent to our shared inbox
join_request = CommunityJoinRequest(user_id=user.id, community_id=community.id) join_request = CommunityJoinRequest(user_id=user.id, community_id=community.id)
db.session.add(join_request) db.session.add(join_request)
member = CommunityMember(user_id=user.id, community_id=community.id)
db.session.add(member)
db.session.commit() db.session.commit()
success = True
if not community.instance.gone_forever:
follow = { follow = {
"actor": current_user.public_url(), "actor": current_user.public_url(),
"to": [community.public_url()], "to": [community.public_url()],