to and cc should be lists

main
Bob Mottram 2024-03-29 15:33:37 +00:00
parent 01a8ab59f5
commit e10f90f121
3 changed files with 5 additions and 1 deletions

View File

@ -988,7 +988,7 @@ def send_follow_request(session, base_dir: str,
'object': followed_id
}
if group_account:
new_follow_json['to'] = followed_id
new_follow_json['to'] = [followed_id]
print('Follow request: ' + str(new_follow_json))
if follow_approval_required(base_dir, nickname, domain, debug,

View File

@ -5795,6 +5795,8 @@ def _receive_follow_request(session, session_onion, session_i2p,
'nickname. Assuming single user instance.')
if not message_json.get('to'):
message_json['to'] = message_json['object']
if not isinstance(message_json['to'], list):
message_json['to'] = [message_json['to']]
if not has_users_path(message_json['object']):
if debug:
print('DEBUG: users/profile/author/channel/accounts ' +

View File

@ -2588,6 +2588,8 @@ def create_direct_message_post(base_dir: str,
auto_cw_cache)
# mentioned recipients go into To rather than Cc
message_json['to'] = message_json['object']['cc']
if not isinstance(message_json['to'], list):
message_json['to'] = [message_json['to']]
message_json['object']['to'] = message_json['to']
message_json['cc'] = []
message_json['object']['cc'] = []