Years ago, my company used an internally hosted XMPP server. When you joined a group chat from another client, it would replay messages that were sent while you weren't connected (or possibly some fixed time period of messages).
With Nayego, we are working on that. https://nayego.net/ you can subscribe if you want to see the preview.