mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
Use original follow id to unsubscribe from a.gup.pe groups
(doesn't properly unsubscribe if gibberish is used)
This commit is contained in:
parent
afe6605ceb
commit
55d47168ce
1 changed files with 6 additions and 1 deletions
|
@ -499,13 +499,18 @@ def unsubscribe(actor):
|
|||
if '@' in actor: # this is a remote community, so activitypub is needed
|
||||
success = True
|
||||
if not community.instance.gone_forever:
|
||||
follow_id = f"https://{current_app.config['SERVER_NAME']}/activities/follow/{gibberish(15)}"
|
||||
if community.instance.domain == 'a.gup.pe':
|
||||
join_request = CommunityJoinRequest.query.filter_by(user_id=current_user.id, community_id=community.id).first()
|
||||
if join_request:
|
||||
follow_id = f"https://{current_app.config['SERVER_NAME']}/activities/follow/{join_request.id}"
|
||||
undo_id = f"https://{current_app.config['SERVER_NAME']}/activities/undo/" + gibberish(15)
|
||||
follow = {
|
||||
"actor": current_user.public_url(),
|
||||
"to": [community.public_url()],
|
||||
"object": community.public_url(),
|
||||
"type": "Follow",
|
||||
"id": f"https://{current_app.config['SERVER_NAME']}/activities/follow/{gibberish(15)}"
|
||||
"id": follow_id
|
||||
}
|
||||
undo = {
|
||||
'actor': current_user.public_url(),
|
||||
|
|
Loading…
Reference in a new issue