Every time I try to think about how to solve various peer to peer communication issues, I mentally reinvent secure #scuttlebutt.
Except there are thing I might change about #ssb to make it a bit lighter. For public messages, I'd give them all IDs starting with zero and just counting upwards. I could ask what the latest ID was and fetch the X most recent with a modification date newer than Y. All of the messages would just be signed with a public key. If the poster deleted a message, the content becomes "[deleted]" and the modification date is updated. This still relies on good behaviour from clients, but to a lesser degree.
For private messages, they'd be encrypted with pgp for the receiver. And still just in the list because mesh networking.
The major problem is follower-only posts which would become some sort of nightmare of the same post re-encrypted for every follower with some sort of horrible, similar thing to replying to it.
Anyway, in my 20s I wanted to wrote some sort of cms for house shares, to manage chores, a calendar, and messaging, but a web interface was always just too much. I keep still thinking about how to solve this problem and I've pivoted to an app that syncs to people nearby. Which I will never write.