Respects visibility of post it's replying to

This commit is contained in:
Mike Lynch 2025-08-25 17:21:23 +10:00
parent 5fdef65846
commit 0df4ab0bcc

View File

@ -208,18 +208,21 @@ async function send_replies(argv, cf) {
status_id: status.id,
account: account.acct,
url: status.url,
in_reply_to_id: status.in_reply_to_id
in_reply_to_id: status.in_reply_to_id,
visibility: status.visibility
};
});
const newmentions = mentions.filter((m) => !oldids.includes(m.id));
for (const mention of newmentions) {
console.log(JSON.stringify(mention, null, 2));
if( mention.in_reply_to_id ) {
console.log(`won't reply to ${mention.id} as it's a reply to ${mention.in_reply_to_id}`);
} else {
console.log(`new mention ${mention.id}`);
const reply = {
id: mention.status_id,
account: `@${mention.account}`
account: `@${mention.account}`,
visibility: mention.visibility,
};
post(argv, cf, reply);
@ -254,6 +257,7 @@ async function post_image(image, alt_text, cf, reply) {
if( reply ) {
status_body["in_reply_to_id"] = reply.id;
status_body["status"] = reply.account;
status_body["visibility"] = reply.visibility;
}
headers['Accept'] = 'application/json';
headers['Content-Type'] = 'application/json';