mirror of https://gitlab.com/bashrc2/epicyon
Improve handling of statuses path
parent
a662f7b951
commit
6ea02514a3
11
posts.py
11
posts.py
|
@ -34,6 +34,7 @@ from webfinger import webfinger_handle
|
||||||
from httpsig import create_signed_header
|
from httpsig import create_signed_header
|
||||||
from siteactive import site_is_active
|
from siteactive import site_is_active
|
||||||
from languages import understood_post_language
|
from languages import understood_post_language
|
||||||
|
from utils import get_actor_from_post_id
|
||||||
from utils import string_contains
|
from utils import string_contains
|
||||||
from utils import get_post_attachments
|
from utils import get_post_attachments
|
||||||
from utils import is_premium_account
|
from utils import is_premium_account
|
||||||
|
@ -3600,8 +3601,9 @@ def add_to_field(activity_type: str, post_json_object: {},
|
||||||
'add_to_field1 "to" field assigned to ' +
|
'add_to_field1 "to" field assigned to ' +
|
||||||
activity_type)
|
activity_type)
|
||||||
to_address = post_json_object['object']
|
to_address = post_json_object['object']
|
||||||
if '/statuses/' in to_address:
|
if contains_statuses(to_address):
|
||||||
to_address = to_address.split('/statuses/')[0]
|
if has_users_path(to_address):
|
||||||
|
to_address = get_actor_from_post_id(to_address)
|
||||||
post_json_object['to'] = [to_address]
|
post_json_object['to'] = [to_address]
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: "to" address added: ' + to_address)
|
print('DEBUG: "to" address added: ' + to_address)
|
||||||
|
@ -3629,8 +3631,9 @@ def add_to_field(activity_type: str, post_json_object: {},
|
||||||
'"to" field assigned to ' +
|
'"to" field assigned to ' +
|
||||||
activity_type)
|
activity_type)
|
||||||
to_address = post_json_object['object']['object']
|
to_address = post_json_object['object']['object']
|
||||||
if '/statuses/' in to_address:
|
if contains_statuses(to_address):
|
||||||
to_address = to_address.split('/statuses/')[0]
|
if has_users_path(to_address):
|
||||||
|
to_address = get_actor_from_post_id(to_address)
|
||||||
post_json_object['object']['to'] = [to_address]
|
post_json_object['object']['to'] = [to_address]
|
||||||
post_json_object['to'] = [to_address]
|
post_json_object['to'] = [to_address]
|
||||||
if debug:
|
if debug:
|
||||||
|
|
Loading…
Reference in New Issue