Respects visibility of post it's replying to
This commit is contained in:
parent
5fdef65846
commit
0df4ab0bcc
@ -208,18 +208,21 @@ 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);
|
||||||
@ -254,6 +257,7 @@ 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';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user