Customized Chat messages and Events in Openfire

We are working on a Chat application for Android Platform and we have a PHP based REST API which takes care of user registration etc.

Openfire was easy to implement to get the Chat happening but post that we are stuck on how to customize the implementation

Here’s is what we need

Chat history should send us user profile pictures, user name, like count

Events to send Like count for a particular Chat

Events to send delete message

Chat history to fetch comments for any media uploaded

Chat history filtered for a particular user.

We have no idea on how to go about this and would appreciate any help in getting this done.