diff --git a/app/models.py b/app/models.py index 032701e9..41f992ba 100644 --- a/app/models.py +++ b/app/models.py @@ -85,7 +85,7 @@ class Instance(db.Model): def votes_are_public(self): if self.trusted is True: # only vote privately with untrusted instances return False - return self.software.lower() == 'lemmy' or self.software.lower() == 'mbin' or self.software.lower() == 'kbin' + return self.software.lower() == 'lemmy' or self.software.lower() == 'mbin' or self.software.lower() == 'kbin' or self.software.lower() == 'guppe groups' def post_count(self): return db.session.execute(text('SELECT COUNT(id) as c FROM "post" WHERE instance_id = :instance_id'), diff --git a/app/post/routes.py b/app/post/routes.py index 120faf1e..eb09185f 100644 --- a/app/post/routes.py +++ b/app/post/routes.py @@ -324,7 +324,11 @@ def post_vote(post_id: int, vote_direction): if instance.inbox and not current_user.has_blocked_instance(instance.id) and not instance_banned(instance.domain): send_to_remote_instance(instance.id, post.community.id, announce) else: - post_request_in_background(post.community.ap_inbox_url, action_json, current_user.private_key, + inbox = post.community.ap_inbox_url + if (post.community.ap_domain and post.author.ap_inbox_url and # sanity check these fields aren't null + post.community.ap_domain == 'a.gup.pe' and vote_direction == 'upvote'): # send upvotes to post author's instance instead of a.gup.pe (who reject them) + inbox = post.author.ap_inbox_url + post_request_in_background(inbox, action_json, current_user.private_key, current_user.public_url(not(post.community.instance.votes_are_public() and current_user.vote_privately())) + '#main-key') recently_upvoted = []