I wrote an xmpp client "jimmy" back in 2000s for java mobile before the android era. It worked fine on my Symbian back then.
Then we used it at our faculty. The jabberd server connected to our ldap too and fetched the directory of all employees so you could chat directly to anyone without messages ever leaving the building. This was around 2010s.
I stopped following dm clients then, but today I'd probably pick Matrix to do the same? Pure p2p chat is tricky. You will always need a kind of a server to store a message when you're offline.