Reworked some code. It's a tiny bit less efficient, but it's also about 1/12 the SLOC and a ton easier to read so I think I'll go with that.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!