user page activities UI: fall back to summary for content

for #286
pull/413/head
Ryan Barrett 2023-02-07 11:45:50 -08:00
rodzic e1856c21a1
commit 48252bf42d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -203,7 +203,9 @@ def fetch_objects(query, user):
if inner_obj: if inner_obj:
inner_obj = json_loads(inner_obj.as1) inner_obj = json_loads(inner_obj.as1)
content = inner_obj.get('content') or inner_obj.get('displayName') content = (inner_obj.get('content')
or inner_obj.get('displayName')
or inner_obj.get('summary'))
url = util.get_first(inner_obj, 'url') or inner_obj.get('id') url = util.get_first(inner_obj, 'url') or inner_obj.get('id')
if url: if url:
content = common.pretty_link(url, text=content, user=user) content = common.pretty_link(url, text=content, user=user)
@ -212,7 +214,9 @@ def fetch_objects(query, user):
obj.phrase = 'updated' obj.phrase = 'updated'
obj_as1['content'] = 'their profile' obj_as1['content'] = 'their profile'
obj.content = obj_as1.get('content') or obj_as1.get('displayName') obj.content = (obj_as1.get('content')
or obj_as1.get('displayName')
or obj_as1.get('summary'))
obj.url = util.get_first(obj_as1, 'url') obj.url = util.get_first(obj_as1, 'url')
if (type in ('like', 'follow', 'repost', 'share') or if (type in ('like', 'follow', 'repost', 'share') or