kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
e6889b4cf6
commit
0d0a4ed642
|
@ -1009,7 +1009,10 @@ class WebmentionTest(testutil.TestCase):
|
|||
'type': 'Update',
|
||||
'id': 'http://localhost/r/https://orig/#update-2022-01-02T03:04:05+00:00',
|
||||
'actor': 'http://localhost/orig',
|
||||
'object': ACTOR_AS2_FULL,
|
||||
'object': {
|
||||
**ACTOR_AS2_FULL,
|
||||
'updated': util.now().isoformat(),
|
||||
},
|
||||
'to': ['https://www.w3.org/ns/activitystreams#Public'],
|
||||
}
|
||||
|
||||
|
@ -1019,6 +1022,7 @@ class WebmentionTest(testutil.TestCase):
|
|||
got_update = json_loads(call[1]['data'])
|
||||
del got_update['object']['publicKey']
|
||||
self.assertEqual(expected_update, got_update)
|
||||
|
||||
activity = Activity.get_by_id(f'https://orig/ {inbox}')
|
||||
self.assertEqual(['orig'], activity.domain)
|
||||
self.assertEqual('out', activity.direction)
|
||||
|
|
|
@ -162,14 +162,14 @@ class Webmention(View):
|
|||
if self.source_as2.get('type') == 'Create':
|
||||
self.source_as2['type'] = 'Update'
|
||||
|
||||
if self.source_as2.get('type') == 'Update':
|
||||
# Mastodon requires the updated field for Updates, so
|
||||
# generate it if it's not already there.
|
||||
# https://docs.joinmastodon.org/spec/activitypub/#supported-activities-for-statuses
|
||||
# https://socialhub.activitypub.rocks/t/what-could-be-the-reason-that-my-update-activity-does-not-work/2893/4
|
||||
# https://github.com/mastodon/documentation/pull/1150
|
||||
self.source_as2.get('object', {}).setdefault(
|
||||
'updated', util.now().isoformat())
|
||||
if self.source_as2.get('type') == 'Update':
|
||||
# Mastodon requires the updated field for Updates, so
|
||||
# generate it if it's not already there.
|
||||
# https://docs.joinmastodon.org/spec/activitypub/#supported-activities-for-statuses
|
||||
# https://socialhub.activitypub.rocks/t/what-could-be-the-reason-that-my-update-activity-does-not-work/2893/4
|
||||
# https://github.com/mastodon/documentation/pull/1150
|
||||
self.source_as2.get('object', {}).setdefault(
|
||||
'updated', util.now().isoformat())
|
||||
|
||||
if self.source_as2.get('type') == 'Follow':
|
||||
# prefer AS2 id or url, if available
|
||||
|
|
Ładowanie…
Reference in New Issue