Today, for the first time in a long while, I'm able to carve out a whole day to work on #Macstodon . So like I did a few weeks back, this is going to be a "live" thread of my attempt to get bookmarks, boosts, and favourites implemented. Maybe replies too, if there's time. Maybe other things if it goes really well and there's lots of time.

#RetroProgramming

First of all, I just fixed the bug that allowed you to have multiple toots selected at once, across different timelines. That's kind of an important one because we need to know _which_ toot is selected in order to interact with it!

I _almost_ have bookmarks working. I wrote a helper function to find the selected toot and timeline that it belongs to, extract the ID, figure out if it's already been bookmarked or not, and make the appropriate API call.

For some reason the HTTP request is failing though, and I'm getting a generic "malformed URL" error, even though the URL is definitely correct, and other requests seem to work just fine. 😕​

OK, fixed it! I wasn't handling the case properly when POSTing to a URL with an empty post body. But it works, and now I can successfully bookmark a toot from within Macstodon 😁​

Unbookmarking doesn't work though - and I think I know why, it's because the previous state of the toot is cached in the timeline. So we don't know that the toot has _already_ been bookmarked, and that we need to unbookmark it instead. Shouldn't be too hard of a fix though.

why is caching so hard ugh
There we go, both bookmarking and unbookmarking work now! Fortunately I should be able to just copy/paste this code to make it work for boosts and favourites as well 😄

Bookmark/unbookmark, favourite/unfavourite, and boosting works now.

But _unboosting_ seems to silently fail for some reason. Not entirely sure why that is yet.

Fixed unboosting. Turns out, when you boost a toot, the API returns the _boosted_ toot, not the original (which makes sense). But you need to look at the _original_ toot to see if you've boosted it or not, and I was overwriting the timeline with the boosted toot.

One thing I want to do before tackling replies: displaying the current boost/favourite counts. That should be pretty easy, right?

Implemented reply, boost, and favourite counts. This required a small UI tweak but I think it turned out pretty good!

Next on the agenda today is implementing support for replies.

@smallsco oh my god i need to try this on my os 9 machine
i mean on that i could probably get classilla to work using a minimal webui but like its not macintosh toolbox enough
@smallsco ah read the readme on github
still wanna see if it runs in the 68k emulator although i could try a different macpython
still incredibly cool tho

@kass9 Once I've "completed" Macstodon I might try building it with a later version of MacPython (which is PPC only) and see if it fixes the bugs I ran into. In theory that should also allow for unicode support and a much faster JSON parser. And then release that as a "Deluxe" version or something.

If you want to give it a try now you can grab MacPython 1.5.2 and run the BuildApplication compiler, selecting the "PPC" or "FAT" option. It will work, but the UI will bug out, the console will be stuck on and you'll get a doubled menu bar...and it will hang on uncaught exceptions. Not a great user experience.

@smallsco ah rip
ill probably just use classilla for my classic mac mastodon needs(?) for now then
maybe when i finally get a color 68k mac ill try this out