kopia lustrzana https://github.com/snarfed/bridgy-fed
Mastodon interop: fill in the updated field for Updates if it's missing
Mastodon requires it: 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/1150pull/373/head
rodzic
1378ab4576
commit
5182bb92f3
|
@ -194,6 +194,9 @@ class WebmentionTest(testutil.TestCase):
|
||||||
}
|
}
|
||||||
self.as2_update = copy.deepcopy(self.as2_create)
|
self.as2_update = copy.deepcopy(self.as2_create)
|
||||||
self.as2_update['type'] = 'Update'
|
self.as2_update['type'] = 'Update'
|
||||||
|
# we should generate this if it's not already in mf2 because Mastodon
|
||||||
|
# requires it for updates
|
||||||
|
self.as2_update['object']['updated'] = util.now().isoformat()
|
||||||
|
|
||||||
self.follow_html = """\
|
self.follow_html = """\
|
||||||
<html>
|
<html>
|
||||||
|
@ -292,6 +295,7 @@ class WebmentionTest(testutil.TestCase):
|
||||||
}
|
}
|
||||||
self.update_as2 = copy.deepcopy(self.create_as2)
|
self.update_as2 = copy.deepcopy(self.create_as2)
|
||||||
self.update_as2['type'] = 'Update'
|
self.update_as2['type'] = 'Update'
|
||||||
|
self.update_as2['object']['updated'] = util.now().isoformat()
|
||||||
|
|
||||||
self.not_fediverse = requests_response("""\
|
self.not_fediverse = requests_response("""\
|
||||||
<html>
|
<html>
|
||||||
|
|
|
@ -137,6 +137,13 @@ class Webmention(View):
|
||||||
|
|
||||||
if source_activity.get('type') == 'Create':
|
if source_activity.get('type') == 'Create':
|
||||||
source_activity['type'] = 'Update'
|
source_activity['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
|
||||||
|
source_activity.get('object', {}).setdefault(
|
||||||
|
'updated', util.now().isoformat())
|
||||||
|
|
||||||
if self.source_obj.get('verb') == 'follow':
|
if self.source_obj.get('verb') == 'follow':
|
||||||
# prefer AS2 id or url, if available
|
# prefer AS2 id or url, if available
|
||||||
|
|
Ładowanie…
Reference in New Issue