The first commit should be pretty clear. This is required by the Activitypub standard, and also helps to simplify our code a bit.
The /activities endpoint is also straightforward, but there is one problem: it will return activities related to private messages or Follow/Accept. We need to add some way to exclude those, maybe a column sensitive on the activity table?
Also this change does not prevent periodically clearing out the activity table. The changes here are only important for new activities, so if those over 1 month old or so are deleted, everything will still work fine. The inbox would throw an error instead of http 200 if somehow an old activity were delivered, and the http endpoint would not find old activities. But those are very minor problems.
For some reason this failed in travis, I restarted the job just to make sure.