1

I am building an Android Application integrated with Quickblox. I am using the quickblox for chats only. I want to know how to check whether the dialogs between the users is present or not. The problem I am facing whenever I click the button new dialog is created and Quickblox is not able to fetch the chats. The main task to check to create the chat activity after clicking the button.

1 Answers1

2

Just use the dialog list data to achive this:

public QBChatDialog getPrivateDialogWithUserId(int id) {
    for (QBChatDialog chatDialog : dialogsMap.values()) {
        if (QBDialogType.PRIVATE.equals(chatDialog.getType())
                && chatDialog.getOccupants().contains(id)) {
            return chatDialog;
        }
    }

    return null;
}
Harminder Singh
  • 316
  • 1
  • 11