Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle boosts. Suggest editing toots too. #5

Merged
merged 3 commits into from Dec 30, 2022

Conversation

fasiha
Copy link
Collaborator

@fasiha fasiha commented Dec 28, 2022

Hi! I'm @22@octodon.social from https://toot.cafe/@zac/109585961042545178. I know I said it should be a tiny change to get PleaseCaption to handle boosts and it was but of course you'd want the bot to say something else when boosts are involved, so I created a new grammar for the boost case and updated the logic to use the that vs the original grammar depending.

Then I noticed that the old grammar only suggested delete-and-redraft. Since Mastodon v4 we can edit toots, but apparently there's a glitch where you have to remove the image and re-add it in order to add captions: https://queer.party/@Rachel_Thorn/109585432701507201

I've signed up for an account for botsin.space but they're reviewing it so I haven't tested it, forgive me. Making this PR untested in case you have an easy way to make sure it works as advertised? If not, no worries! I'll get a second account and test it. See commentary below :)

Thanks for this!

@fasiha
Copy link
Collaborator Author

fasiha commented Dec 29, 2022

Ahh, a few bugs/tweaks needed but now with 3f6fddb, it works 😄!

Screen Shot 2022-12-29 at 13 44 17

Changes needed:

  • follow with relogs: true so we get notified of boosts
  • JSON syntax errors 😔
  • let doesMessageHaveUnCaptionedImages just get toots, not streaming messages, so that we can recursively call it on boosts if needed.

Open questions:

  1. do you like the changes in the original grammar telling folks they can edit their toots to add image captions? Should I put that in a separate PR? Should I remove this (since other Fedi clients don't support edits)?
  2. (I think right now, the bot doesn't delete its DMs if you edit/redraft (or unboost) the offending toot, is that so? Maybe if you're ok with it, I can look at that next?)

@zoetrope69
Copy link
Owner

Looks great, let's merge it in, deploy and see what breaks lol.

As for the auto deletion you're welcome to work on that it has been requested before.

@zoetrope69 zoetrope69 merged commit 763b774 into zoetrope69:master Dec 30, 2022
@fasiha fasiha deleted the fasiha-boost-edit branch December 30, 2022 23:45
fasiha added a commit to fasiha/please-caption-mastodon-backup that referenced this pull request Aug 29, 2023
fasiha added a commit that referenced this pull request Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants