Yep. You'd need a server somewhere to store and replay that message history. There is an XMPP standard that specifies how to do that. Question is whether or not your client can speak that protocol.
curiousity piqued, what's the XEP number for the protocol?
XEP-136 is a good example why it's a bad idea to squeeze
everything into a single specification (or XEP in this case): The reason it was not implemented by most XMPP stacks was, because it's so much you have to implement. XEP-313 focuses on what is important to achieve WhatsApp like persistent chats in XMPP. Functionality which is lacking in XEP-313 can be specified later on in a different XEP. After all that's why it is called the "Extensible Message and Presence Protocol (XMPP)".