Self-hosted ( if you want that ) but not P2P: https://about.mattermost.com/
Problem still stands, when your self-hosted instance/software goes down, I still can't communicate with people sitting literally meters away from me, connected to the same WiFi. It's incredibly stupid.
That doesn't seem like a problem that software can solve.
P2P networks can also work even if you're not connected to the same network. Point being that it's a direct connection to the person that you're communicating with, with no indirection.
* At one point we had to re-login to the client, because our ssl cert expired (let's encrypt), I think.
These issues might be because we ran the server from a home internet connection, but I run a lot of things from home without issue.