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;
}
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;
}
Aggregations