Search in sources :

Example 1 with CallStartResult

use of com.fanap.podchat.call.result_model.CallStartResult in project pod-chat-android-sdk by FanapSoft.

the class CallAsyncRequestsManager method fillResult.

public static ChatResponse<CallStartResult> fillResult(ChatResponse<StartedCallModel> callResponse) {
    ChatResponse<CallStartResult> response = new ChatResponse<>();
    ArrayList<CallParticipantVO> callPartners = new ArrayList<>();
    if (Util.isNotNullOrEmpty(callResponse.getResult().getOtherClientDtoList())) {
        for (ClientDTO client : callResponse.getResult().getOtherClientDtoList()) {
            if (!client.getUserId().equals(CoreConfig.userId)) {
                CallParticipantVO partner = new CallParticipantVO();
                partner.setUserId(client.getUserId());
                partner.setMute(client.getMute());
                partner.setVideo(client.getVideo());
                callPartners.add(partner);
            }
        }
    }
    CallStartResult result = new CallStartResult(callResponse.getResult().getCallName(), callResponse.getResult().getCallImage(), callPartners);
    response.setResult(result);
    response.setSubjectId(callResponse.getSubjectId());
    response.setUniqueId(callResponse.getUniqueId());
    return response;
}
Also used : CallStartResult(com.fanap.podchat.call.result_model.CallStartResult) CallParticipantVO(com.fanap.podchat.call.model.CallParticipantVO) ChatResponse(com.fanap.podchat.model.ChatResponse) ClientDTO(com.fanap.podchat.call.model.ClientDTO) SendClientDTO(com.fanap.podchat.call.model.SendClientDTO) ArrayList(java.util.ArrayList)

Aggregations

CallParticipantVO (com.fanap.podchat.call.model.CallParticipantVO)1 ClientDTO (com.fanap.podchat.call.model.ClientDTO)1 SendClientDTO (com.fanap.podchat.call.model.SendClientDTO)1 CallStartResult (com.fanap.podchat.call.result_model.CallStartResult)1 ChatResponse (com.fanap.podchat.model.ChatResponse)1 ArrayList (java.util.ArrayList)1