chat-sdk / chat-sdk-android

Chat SDK Android - Open Source Mobile Messenger

Home Page:https://chatsdk.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting all messages from a user

basimsherif opened this issue · comments

Currently, I am using thread().getMessages() to get all messages from a thread. But due to some issues, I am getting duplicate threads for the same user. Is there any way I can get a merged list of all messages, sent and received from a user? So basically, I need to merge all the messages from all threads from the same user.

@basimsherif can you give me some more context. I need to know which code you're using to try to get the threads for the user.

Below is the method I use to get the thread while sending a message to user,

thread().createThread(Collections.singletonList(user))
.subscribe { thread1: Thread? ->
}

And I use the below code to list all the threads for all users, where I am getting duplicates

thread().getThreads(ThreadType.Private1to1)

When you say they are duplicates, can you explain what you mean?

I am getting two threads from the same user, when I use the below method,
thread().getThreads(ThreadType.Private1to1)
Please see the screenshot below,

Screenshot_20210305-190234