mirror of https://gitlab.com/bashrc2/epicyon
Debug when adding to field
parent
4c0927bac0
commit
5c98a3be81
17
posts.py
17
posts.py
|
@ -2917,11 +2917,15 @@ def add_to_field(activity_type: str, post_json_object: {},
|
||||||
if post_json_object['type'] == activity_type:
|
if post_json_object['type'] == activity_type:
|
||||||
is_same_type = True
|
is_same_type = True
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: "to" field assigned to ' + activity_type)
|
print('DEBUG: ' +
|
||||||
|
'add_to_field1 "to" field assigned to ' +
|
||||||
|
activity_type)
|
||||||
to_address = post_json_object['object']
|
to_address = post_json_object['object']
|
||||||
if '/statuses/' in to_address:
|
if '/statuses/' in to_address:
|
||||||
to_address = to_address.split('/statuses/')[0]
|
to_address = to_address.split('/statuses/')[0]
|
||||||
post_json_object['to'] = [to_address]
|
post_json_object['to'] = [to_address]
|
||||||
|
if debug:
|
||||||
|
print('DEBUG: "to" address added: ' + to_address)
|
||||||
to_field_added = True
|
to_field_added = True
|
||||||
elif has_object_dict(post_json_object):
|
elif has_object_dict(post_json_object):
|
||||||
# add a to field to bookmark add or remove
|
# add a to field to bookmark add or remove
|
||||||
|
@ -2943,14 +2947,16 @@ def add_to_field(activity_type: str, post_json_object: {},
|
||||||
is_same_type = True
|
is_same_type = True
|
||||||
if isinstance(post_json_object['object']['object'], str):
|
if isinstance(post_json_object['object']['object'], str):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: "to" field assigned to ' +
|
print('DEBUG: add_to_field2 ' +
|
||||||
|
'"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 '/statuses/' in to_address:
|
||||||
to_address = to_address.split('/statuses/')[0]
|
to_address = to_address.split('/statuses/')[0]
|
||||||
post_json_object['object']['to'] = [to_address]
|
post_json_object['object']['to'] = [to_address]
|
||||||
post_json_object['to'] = \
|
post_json_object['to'] = [to_address]
|
||||||
[post_json_object['object']['object']]
|
if debug:
|
||||||
|
print('DEBUG: "to" address added: ' + to_address)
|
||||||
to_field_added = True
|
to_field_added = True
|
||||||
|
|
||||||
if not is_same_type:
|
if not is_same_type:
|
||||||
|
@ -3012,7 +3018,8 @@ def _send_to_named_addresses(session, base_dir: str,
|
||||||
post_json_obj2 = post_json_object['object']['object']
|
post_json_obj2 = post_json_object['object']['object']
|
||||||
if isinstance(post_json_obj2, str):
|
if isinstance(post_json_obj2, str):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: "to" field assigned to Follow')
|
print('DEBUG: _send_to_named_addresses ' +
|
||||||
|
'"to" field assigned to Follow')
|
||||||
post_json_object['object']['to'] = \
|
post_json_object['object']['to'] = \
|
||||||
[post_json_object['object']['object']]
|
[post_json_object['object']['object']]
|
||||||
if not post_json_object['object'].get('to'):
|
if not post_json_object['object'].get('to'):
|
||||||
|
|
Loading…
Reference in New Issue