Search in sources :

Example 1 with LinkedUser

use of com.fanap.podchat.mainmodel.LinkedUser 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 2 with LinkedUser

use of com.fanap.podchat.mainmodel.LinkedUser in project pod-chat-android-sdk by FanapSoft.

the class Util method getReformatOutPutAddContact.

@NonNull
public static ChatResponse<ResultAddContact> getReformatOutPutAddContact(Contacts contacts, String uniqueId) {
    ChatResponse<ResultAddContact> chatResponse = new ChatResponse<>();
    chatResponse.setUniqueId(uniqueId);
    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 : ChatResponse(com.fanap.podchat.model.ChatResponse) ResultAddContact(com.fanap.podchat.model.ResultAddContact) LinkedUser(com.fanap.podchat.mainmodel.LinkedUser) Contact(com.fanap.podchat.mainmodel.Contact) ResultAddContact(com.fanap.podchat.model.ResultAddContact) NonNull(android.support.annotation.NonNull)

Aggregations

Contact (com.fanap.podchat.mainmodel.Contact)2 LinkedUser (com.fanap.podchat.mainmodel.LinkedUser)2 ChatResponse (com.fanap.podchat.model.ChatResponse)2 ResultAddContact (com.fanap.podchat.model.ResultAddContact)2 NonNull (android.support.annotation.NonNull)1 BlockedContact (com.fanap.podchat.mainmodel.BlockedContact)1 Contacts (com.fanap.podchat.model.Contacts)1 ResultRemoveContact (com.fanap.podchat.model.ResultRemoveContact)1 RequestAddContact (com.fanap.podchat.requestobject.RequestAddContact)1