Ok, in this case, I think, you need to write your own Openfire plugin and either use REST api to query the unread messages of your contacts or use a custom XMPP extension protocol (some IQ-get).
Unread is also different to undelivered. If you just ask the OfflineStorage for undelivered messages, it would be the easiest. Displaying delivered, but unread messages is hard to do. It would involve some protocol for the receiving client, too.