kopia lustrzana https://github.com/snarfed/bridgy-fed
bug fix, don't deliver activities to users if their Follower is inactive
rodzic
fa2a9a1afe
commit
bc15902bed
|
@ -235,6 +235,7 @@ def inbox(domain=None):
|
|||
if obj.type in ('share', 'create', 'post') and actor and actor_id:
|
||||
logger.info(f'Delivering to followers of {actor_id}')
|
||||
for f in Follower.query(Follower.dest == actor_id,
|
||||
Follower.status == 'active',
|
||||
projection=[Follower.src]):
|
||||
if f.src not in obj.domains:
|
||||
obj.domains.append(f.src)
|
||||
|
|
|
@ -365,6 +365,7 @@ class ActivityPubTest(testutil.TestCase):
|
|||
Follower.get_or_create(NOTE['actor'], 'foo.com')
|
||||
Follower.get_or_create('http://other/actor', 'bar.com')
|
||||
Follower.get_or_create(NOTE['actor'], 'baz.com')
|
||||
Follower.get_or_create(NOTE['actor'], 'baj.com', status='inactive')
|
||||
|
||||
mock_head.return_value = requests_response(url='http://target')
|
||||
mock_get.return_value = self.as2_resp(ACTOR) # source actor
|
||||
|
@ -440,6 +441,7 @@ class ActivityPubTest(testutil.TestCase):
|
|||
def test_shared_inbox_repost(self, mock_head, mock_get, mock_post):
|
||||
Follower.get_or_create(ACTOR['id'], 'foo.com')
|
||||
Follower.get_or_create(ACTOR['id'], 'baz.com')
|
||||
Follower.get_or_create(ACTOR['id'], 'baj.com', status='inactive')
|
||||
|
||||
mock_head.return_value = requests_response(url='http://target')
|
||||
mock_get.side_effect = [
|
||||
|
|
Ładowanie…
Reference in New Issue