From e10f90f121f6e6a94b44cee1824a663fa51cbceb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 29 Mar 2024 15:33:37 +0000 Subject: [PATCH] to and cc should be lists --- follow.py | 2 +- inbox.py | 2 ++ posts.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/follow.py b/follow.py index 859807ab5..3572579e2 100644 --- a/follow.py +++ b/follow.py @@ -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, diff --git a/inbox.py b/inbox.py index e2c25e8bb..421e0722b 100644 --- a/inbox.py +++ b/inbox.py @@ -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 ' + diff --git a/posts.py b/posts.py index 3c9f1a660..58c6927eb 100644 --- a/posts.py +++ b/posts.py @@ -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'] = []