public List<OfflineMessageHeader> requestMessageHeaders() throws XmppException {
List<OfflineMessageHeader> result = new ArrayList<>();
ServiceDiscoveryManager serviceDiscoveryManager = xmppSession.getExtensionManager(ServiceDiscoveryManager.class);
ItemNode itemNode = serviceDiscoveryManager.discoverItems(null, OfflineMessage.NAMESPACE);
for (Item item : itemNode.getItems()) {
result.add(new OfflineMessageHeader(Jid.valueOf(item.getName()), item.getNode()));
}
return result;
}