kopia lustrzana https://gitlab.com/jaywink/federation
Use the profile.finger property to generate AP Mention objects
rodzic
76300e7b4a
commit
373aaa8da0
|
@ -875,7 +875,7 @@ class Note(Object, RawContentMixin):
|
||||||
mentions.sort()
|
mentions.sort()
|
||||||
for mention in mentions:
|
for mention in mentions:
|
||||||
if validate_handle(mention):
|
if validate_handle(mention):
|
||||||
profile = get_profile(handle=mention)
|
profile = get_profile(finger=mention)
|
||||||
# only add AP profiles mentions
|
# only add AP profiles mentions
|
||||||
if getattr(profile, 'id', None):
|
if getattr(profile, 'id', None):
|
||||||
self.tag_objects.append(Mention(href=profile.id, name='@'+mention))
|
self.tag_objects.append(Mention(href=profile.id, name='@'+mention))
|
||||||
|
@ -891,7 +891,7 @@ class Note(Object, RawContentMixin):
|
||||||
for tag in self.tag_objects:
|
for tag in self.tag_objects:
|
||||||
if isinstance(tag, Mention):
|
if isinstance(tag, Mention):
|
||||||
profile = get_profile_or_entity(fid=tag.href)
|
profile = get_profile_or_entity(fid=tag.href)
|
||||||
handle = getattr(profile, 'handle', None)
|
handle = getattr(profile, 'finger', None)
|
||||||
if handle: self._mentions.add(handle)
|
if handle: self._mentions.add(handle)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -2,7 +2,6 @@ import copy
|
||||||
import importlib
|
import importlib
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from pprint import pprint
|
|
||||||
import traceback
|
import traceback
|
||||||
from typing import List, Dict, Union
|
from typing import List, Dict, Union
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue