Being the tinfoil hat I am I obviously don’t like nor use whatsapp, some time ago I set up my own XMPP server and made a bunch of close friends switch to it.
There are multiple clients for every platform, my personal preference goes to Xabber on Android and Pidgin on GNU/Linux; both support OTR encryption and all around are pretty decent clients.
The only real issue we had so far is the very annoying problem of lost messages; if the internet connection is stable and decent the problem will very likely never come up, too bad that mobile phone internet connection is everything but stable.
Every time there is a switch between EDGE, 3G, HSDPA and 4G the mobile phone is out of reach for some seconds (some time much more than just some).
The switch between let’s say 3G and HSDPA is not predictable, so the client has physically no time to notificate the server that he is about to close the connection and on the other hand the server also has some trouble knowing if someone suddenly disconnect.
Here comes XEP-199 a.k.a. XMPP ping, it is used to probe the clients connection state every X seconds, in my ejabbed (the XMPP server I use) configuration it is set to 60 seconds, so every 60 seconds the server ping every client, if after 32 additional seconds a client has not replied it will be considered as disconnected and any further message sent from everyone to it will be cached by the server and resent the next time the client will be back online.
Enable XEP-199 in ejabberd is pretty easy…
…