Compare commits

..

No commits in common. "main" and "bugfix-no-replies-to-replies" have entirely different histories.

View File

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