Search in sources :

Example 71 with ChatResponse

use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.

the class PodUploader method generateImageUploadResultForSendMessage.

public static ChatResponse<ResultFile> generateImageUploadResultForSendMessage(UploadToPodSpaceResult response, String uniqueId) {
    ResultFile result = PodUploader.generateFileUploadResult(response);
    ChatResponse<ResultFile> chatResponse = new ChatResponse<>();
    chatResponse.setResult(result);
    chatResponse.setUniqueId(uniqueId);
    return chatResponse;
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) ResultFile(com.fanap.podchat.model.ResultFile)

Example 72 with ChatResponse

use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.

the class HashTagManager method getMentionListResponse.

public static ChatResponse<ResultHistory> getMentionListResponse(ChatMessage chatMessage) {
    List<MessageVO> messageVOS = getMessageVOSFromChatMessage(chatMessage);
    ResultHistory resultHistory = new ResultHistory();
    resultHistory.setContentCount(chatMessage.getContentCount());
    resultHistory.setHistory(messageVOS);
    ChatResponse<ResultHistory> finalResponse = new ChatResponse<>();
    finalResponse.setResult(resultHistory);
    finalResponse.setUniqueId(chatMessage.getUniqueId());
    finalResponse.setSubjectId(chatMessage.getSubjectId());
    return finalResponse;
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) MessageVO(com.fanap.podchat.mainmodel.MessageVO) ResultHistory(com.fanap.podchat.model.ResultHistory)

Example 73 with ChatResponse

use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.

the class ContactManager method prepareGetBlockListFromCache.

public static ChatResponse<ResultBlockList> prepareGetBlockListFromCache(String uniqueId, List<BlockedContact> cacheContacts) {
    ChatResponse<ResultBlockList> chatResponse = new ChatResponse<>();
    chatResponse.setErrorCode(0);
    chatResponse.setHasError(false);
    chatResponse.setUniqueId(uniqueId);
    chatResponse.setCache(true);
    ResultBlockList resultBlockList = new ResultBlockList();
    resultBlockList.setContacts(cacheContacts);
    chatResponse.setResult(resultBlockList);
    return chatResponse;
}
Also used : ChatResponse(com.fanap.podchat.model.ChatResponse) ResultBlockList(com.fanap.podchat.model.ResultBlockList)

Example 74 with ChatResponse

use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.

the class ContactManager method prepareAddContactResponse.

public static ChatResponse<ResultAddContact> prepareAddContactResponse(ChatMessage chatMessage) {
    Contacts contacts = App.getGson().fromJson(chatMessage.getContent(), Contacts.class);
    ChatResponse<ResultAddContact> chatResponse = new ChatResponse<>();
    chatResponse.setUniqueId(chatMessage.getUniqueId());
    ResultAddContact resultAddContact = new ResultAddContact();
    resultAddContact.setContentCount(1);
    Contact contact = new Contact();
    contact.setCellphoneNumber(contacts.getResult().get(0).getCellphoneNumber());
    contact.setEmail(contacts.getResult().get(0).getEmail());
    contact.setFirstName(contacts.getResult().get(0).getFirstName());
    contact.setId(contacts.getResult().get(0).getId());
    contact.setLastName(contacts.getResult().get(0).getLastName());
    contact.setUniqueId(contacts.getResult().get(0).getUniqueId());
    // add linked user
    LinkedUser linkedUser = contacts.getResult().get(0).getLinkedUser();
    if (linkedUser != null)
        contact.setLinkedUser(linkedUser);
    resultAddContact.setContact(contact);
    chatResponse.setResult(resultAddContact);
    return chatResponse;
}
Also used : Contacts(com.fanap.podchat.model.Contacts) ChatResponse(com.fanap.podchat.model.ChatResponse) ResultAddContact(com.fanap.podchat.model.ResultAddContact) LinkedUser(com.fanap.podchat.mainmodel.LinkedUser) BlockedContact(com.fanap.podchat.mainmodel.BlockedContact) ResultRemoveContact(com.fanap.podchat.model.ResultRemoveContact) Contact(com.fanap.podchat.mainmodel.Contact) ResultAddContact(com.fanap.podchat.model.ResultAddContact) RequestAddContact(com.fanap.podchat.requestobject.RequestAddContact)

Example 75 with ChatResponse

use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.

the class ContactManager method prepareContactSyncedResult.

public static ChatResponse<ContactSyncedResult> prepareContactSyncedResult(ChatMessage chatMessage) {
    ChatResponse<ContactSyncedResult> response = new ChatResponse<>();
    ContactSyncedResult result = new ContactSyncedResult(chatMessage.getSubjectId());
    response.setResult(result);
    return response;
}
Also used : ContactSyncedResult(com.fanap.podchat.chat.contact.result_model.ContactSyncedResult) ChatResponse(com.fanap.podchat.model.ChatResponse)

Aggregations

ChatResponse (com.fanap.podchat.model.ChatResponse)162 ChatListener (com.fanap.podchat.chat.ChatListener)38 Test (org.junit.Test)38 ArrayList (java.util.ArrayList)35 Thread (com.fanap.podchat.mainmodel.Thread)29 JsonSyntaxException (com.google.gson.JsonSyntaxException)29 ResultHistory (com.fanap.podchat.model.ResultHistory)28 LargeTest (android.support.test.filters.LargeTest)27 RequestThread (com.fanap.podchat.requestobject.RequestThread)27 PodChatException (com.fanap.podchat.util.PodChatException)26 MessageVO (com.fanap.podchat.mainmodel.MessageVO)25 RoomIntegrityException (com.fanap.podchat.persistance.RoomIntegrityException)23 IOException (java.io.IOException)23 JSONException (org.json.JSONException)22 ResultThreads (com.fanap.podchat.model.ResultThreads)21 RequestGetHistory (com.fanap.podchat.requestobject.RequestGetHistory)21 SentryException (io.sentry.core.protocol.SentryException)21 FlakyTest (android.support.test.filters.FlakyTest)19 MediumTest (android.support.test.filters.MediumTest)19 Activity (android.app.Activity)17