Use the profile.finger property to generate AP Mention objects

jsonld-outbound
Alain St-Denis 2022-11-21 16:44:11 +00:00
rodzic 76300e7b4a
commit 373aaa8da0
2 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -875,7 +875,7 @@ class Note(Object, RawContentMixin):
mentions.sort()
for mention in mentions:
if validate_handle(mention):
profile = get_profile(handle=mention)
profile = get_profile(finger=mention)
# only add AP profiles mentions
if getattr(profile, 'id', None):
self.tag_objects.append(Mention(href=profile.id, name='@'+mention))
@ -891,7 +891,7 @@ class Note(Object, RawContentMixin):
for tag in self.tag_objects:
if isinstance(tag, Mention):
profile = get_profile_or_entity(fid=tag.href)
handle = getattr(profile, 'handle', None)
handle = getattr(profile, 'finger', None)
if handle: self._mentions.add(handle)
@property

Wyświetl plik

@ -2,7 +2,6 @@ import copy
import importlib
import json
import logging
from pprint import pprint
import traceback
from typing import List, Dict, Union