update profile bug fix, update local user as well as sending fediverse Update

thanks for reporting @KR4DIO!
pull/542/head
Ryan Barrett 2023-06-10 07:16:54 -07:00
rodzic c98ab3f2d5
commit 9ee616b4c2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 18 dodań i 1 usunięć

Wyświetl plik

@ -69,6 +69,16 @@ ACTOR_AS2 = {
'name': 'Ms. ☕ Baz',
'preferredUsername': 'user.com',
}
ACTOR_AS2_USER = {
'type': 'Person',
'url': 'https://user.com/',
'name': 'Ms. ☕ Baz',
'attachment': [{
'name': 'Ms. ☕ Baz',
'type': 'PropertyValue',
'value': '<a rel="me" href="https://user.com/">user.com</a>',
}],
}
ACTOR_AS2_FULL = {
**ACTOR_AS2,
'@context': [
@ -1361,6 +1371,9 @@ class WebTest(TestCase):
self.assert_deliveries(mock_post, ('https://shared/inbox', 'https://inbox'),
expected_as2)
# updated Web user
self.assert_user(Web, 'user.com', actor_as2=ACTOR_AS2_USER, direct=True)
# homepage object
self.assert_object('https://user.com/',
source_protocol='web',

6
web.py
Wyświetl plik

@ -462,9 +462,13 @@ def webmention_task():
props['author'] = [g.user.ap_actor()]
logger.info(f'Converted to AS1: {obj.type}: {json_dumps(obj.as1, indent=2)}')
# if source is home page, send an actor Update to followers' instances
# if source is home page, update Web user and send an actor Update to
# followers' instances
if g.user.is_web_url(obj.key.id()):
obj.put()
g.user.actor_as2 = as2.from_as1(obj.as1)
g.user.put()
actor_as1 = {
**obj.as1,
'id': g.user.ap_actor(),