If you really want control, look at the Matrix ecosystem. The server (Synapse) can be self-hosted and you can easily turn off or limit federation if you don't want the ability to talk with other instances.
Its completely open source and very easy to setup imo. And, the entire French government trusts it and uses it for day to day work, so its not going to be abandoned any time soon.
https://matrix.org/blog/2018/04/26/matrix-and-riot-confirmed...