support anonymous react_list

This commit is contained in:
jessop 2020-09-27 16:36:51 -04:00
parent d6ee6446dd
commit 0231139b01

View file

@ -5334,8 +5334,7 @@ class Daemon(metaclass=JSONRPCServerType):
Usage: Usage:
comment_react_list (--comment_ids=<comment_ids>) comment_react_list (--comment_ids=<comment_ids>)
(--channel_id=<channel_id>) [(--channel_id=<channel_id>)(--channel_name=<channel_name>)]
(--channel_name=<channel_name>)
[--react_types=<react_types>] [--react_types=<react_types>]
Options: Options:
@ -5363,18 +5362,19 @@ class Daemon(metaclass=JSONRPCServerType):
} }
""" """
wallet = self.wallet_manager.get_wallet_or_default(wallet_id) wallet = self.wallet_manager.get_wallet_or_default(wallet_id)
react_list_body = {
'comment_ids': comment_ids,
}
if channel_id:
channel = await self.get_channel_or_error( channel = await self.get_channel_or_error(
wallet, channel_account_id, channel_id, channel_name, for_signing=True wallet, channel_account_id, channel_id, channel_name, for_signing=True
) )
react_list_body['channel_id'] = channel_id
react_list_body = { react_list_body['channel_name'] = channel.claim_name
'comment_ids': comment_ids,
'channel_id': channel_id,
'channel_name': channel.claim_name,
}
if react_types: if react_types:
react_list_body['types'] = react_types react_list_body['types'] = react_types
if channel_id:
comment_client.sign_reaction(react_list_body, channel) comment_client.sign_reaction(react_list_body, channel)
response = await comment_client.jsonrpc_post(self.conf.comment_server, 'reaction.List', react_list_body) response = await comment_client.jsonrpc_post(self.conf.comment_server, 'reaction.List', react_list_body)
return response return response