Filter messages obtained through REST API

I am using the following plugin to receive message history through REST services

plugin

the problem is that they mix the chat messages one by one and the multiuser or gorupchat, I would like to know if there is any way to filter these?

when consulting the chat messages one by one of the user 16726858 @ localhost, these are mixed with the messages of the groupchat:

imagen