Search in sources :

Example 1 with RequestThreadParticipant

use of com.fanap.podchat.requestobject.RequestThreadParticipant in project pod-chat-android-sdk by FanapSoft.

the class ChatActivity method getThreadParticipants.

private void getThreadParticipants() {
    RequestThreadParticipant request = new RequestThreadParticipant.Builder().count(20).offset(0).threadId(TEST_THREAD_ID).build();
    presenter.getThreadParticipant(request);
// presenter.getThreadParticipant(20, null, TEST_THREAD_ID, new ChatHandler() {
// @Override
// public void onGetThreadParticipant(String uniqueId) {
// super.onGetThreadParticipant(uniqueId);
// }
// });
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) RequestThreadParticipant(com.fanap.podchat.requestobject.RequestThreadParticipant)

Example 2 with RequestThreadParticipant

use of com.fanap.podchat.requestobject.RequestThreadParticipant in project pod-chat-android-sdk by FanapSoft.

the class ChatPresenter method getThreadParticipant.

@Override
public void getThreadParticipant(int count, Long offset, long threadId, ChatHandler handler) {
    RequestThreadParticipant participant = new RequestThreadParticipant.Builder(threadId).count(50).offset(0).build();
    chat.getThreadParticipants(participant, handler);
// chat.getThreadParticipants(count, offset, threadId, handler);
}
Also used : RequestThreadParticipant(com.fanap.podchat.requestobject.RequestThreadParticipant)

Example 3 with RequestThreadParticipant

use of com.fanap.podchat.requestobject.RequestThreadParticipant in project pod-chat-android-sdk by FanapSoft.

the class AssistantCacheTest method populateParticipantList.

@Test
public void populateParticipantList() {
    populateThreadsListFromServerOnly();
    assert threads.size() > 0;
    Thread thread = getValidGroupThread();
    chatListeners = new ChatListener() {

        @Override
        public void onGetThreadParticipant(String content, ChatResponse<ResultParticipant> response) {
            System.out.println("Received Participant, Cache: " + response.isCache() + " Content: " + content);
            if (response.getResult().getParticipants().size() > 1) {
                threadParticipant.addAll(response.getResult().getParticipants());
                chat.removeListener(chatListeners);
                resumeProcess();
            } else {
                threads.remove(thread);
                Thread t2 = getValidGroupThread();
                print("try again changing thread...");
                RequestThreadParticipant request = new RequestThreadParticipant.Builder().threadId(t2.getId()).build();
                chat.getThreadParticipants(request, null);
            }
        }
    };
    chat.addListener(chatListeners);
    RequestThreadParticipant request = new RequestThreadParticipant.Builder().threadId(thread.getId()).build();
    chat.getThreadParticipants(request, null);
    pauseProcess();
}
Also used : ResultParticipant(com.fanap.podchat.model.ResultParticipant) ChatListener(com.fanap.podchat.chat.ChatListener) Thread(com.fanap.podchat.mainmodel.Thread) RequestThread(com.fanap.podchat.requestobject.RequestThread) RequestThreadParticipant(com.fanap.podchat.requestobject.RequestThreadParticipant) Test(org.junit.Test) LargeTest(android.support.test.filters.LargeTest)

Aggregations

RequestThreadParticipant (com.fanap.podchat.requestobject.RequestThreadParticipant)3 LargeTest (android.support.test.filters.LargeTest)1 ChatListener (com.fanap.podchat.chat.ChatListener)1 Thread (com.fanap.podchat.mainmodel.Thread)1 ResultParticipant (com.fanap.podchat.model.ResultParticipant)1 RequestThread (com.fanap.podchat.requestobject.RequestThread)1 GsonBuilder (com.google.gson.GsonBuilder)1 Test (org.junit.Test)1