one to one Public chat message count showing wrong.
slpatidar opened this issue · comments
patidar sundar commented
when get the "thread.getMessages().size()" its returning wrong count .
I want to set a limitation for the chat message sent, but mostly the time when I trying to fetch the current sent message count it's returning the wrong count. I have sent only 20 messages to another user, and it's showing 24. how to get the exact count of the message between the user.
I have tried with following methods
1.messageListAdapter.getItemCount()
2.messageListAdapter.getMessageItems().size()
3. thread.getMessages().size()
Please help
Ben Smiley commented
This is because that method lazy loads messages. Use this instead:
List<Message> messages = getMessagesWithOrder(DaoCore.ORDER_DESC, Integer.MAX_VALUE);