Search in sources :

Example 1 with CreateCallVO

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

the class CallPresenter method setCallInfo.

@Override
public void setCallInfo(CallInfo callInfo) {
    if (callVO == null) {
        isInCall = true;
        callVO = new CreateCallVO();
        callVO.setCallId(callInfo.getCallId());
    }
}
Also used : CreateCallVO(com.fanap.podchat.call.model.CreateCallVO)

Example 2 with CreateCallVO

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

the class CallPresenter method initCallVoByCallWrapper.

private void initCallVoByCallWrapper(CallWrapper call) {
    callVO = new CreateCallVO();
    callVO.setCallId(call.getId());
    callVO.setGroup(call.isGroup());
    callVO.setConversationVO(call.getConversationVO());
    callVO.setCreatorId(call.getCreatorId());
    callVO.setType(call.getType());
}
Also used : CreateCallVO(com.fanap.podchat.call.model.CreateCallVO)

Example 3 with CreateCallVO

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

the class CallAsyncRequestsManager method createGroupCallRequestMessage.

public static String createGroupCallRequestMessage(CallRequest request, String uniqueId) {
    CreateCallVO createCallVO = new CreateCallVO();
    createCallVO.setGroup(true);
    createCallVO.setCreatorId(CoreConfig.userId);
    if (request.getSubjectId() <= 0)
        createCallVO.setInvitees(request.getInvitees());
    else
        createCallVO.setThreadId(request.getSubjectId());
    createCallVO.setType(request.getCallType());
    CreateCallThread callThread = null;
    if (Util.isNotNullOrEmpty(request.getTitle())) {
        callThread = new CreateCallThread();
        callThread.setTitle(request.getTitle());
    }
    if (Util.isNotNullOrEmpty(request.getImage())) {
        if (callThread == null)
            callThread = new CreateCallThread();
        callThread.setImage(request.getImage());
    }
    if (Util.isNotNullOrEmpty(request.getDescription())) {
        if (callThread == null)
            callThread = new CreateCallThread();
        callThread.setDescription(request.getDescription());
    }
    if (Util.isNotNullOrEmpty(request.getMetadata())) {
        if (callThread == null)
            callThread = new CreateCallThread();
        callThread.setMetadata(request.getMetadata());
    }
    if (Util.isNotNullOrEmpty(request.getUniqueName())) {
        if (callThread == null)
            callThread = new CreateCallThread();
        callThread.setUniqueName(request.getUniqueName());
    }
    if (callThread != null) {
        createCallVO.setCreateCallThreadRequest(callThread);
    }
    SendClientDTO sendClientDTO = new SendClientDTO();
    sendClientDTO.setVideo(request.getCallType() == CallType.Constants.VIDEO_CALL);
    sendClientDTO.setMute(false);
    sendClientDTO.setClientType(ClientType.Constants.ANDROID);
    JsonObject contentObj = (JsonObject) App.getGson().toJsonTree(createCallVO);
    JsonElement clientDtoObj = App.getGson().toJsonTree(sendClientDTO);
    contentObj.add("creatorClientDto", clientDtoObj);
    if (callThread == null) {
        contentObj.remove("createCallThreadRequest");
    }
    AsyncMessage message = new AsyncMessage();
    message.setContent(contentObj.toString());
    message.setType(ChatMessageType.Constants.GROUP_CALL_REQUEST);
    message.setToken(CoreConfig.token);
    message.setTokenIssuer(CoreConfig.tokenIssuer);
    message.setUniqueId(uniqueId);
    JsonObject messageObj = (JsonObject) App.getGson().toJsonTree(message);
    messageObj.remove("subjectId");
    return messageObj.toString();
}
Also used : SendClientDTO(com.fanap.podchat.call.model.SendClientDTO) JsonElement(com.google.gson.JsonElement) AsyncMessage(com.fanap.podchat.mainmodel.AsyncMessage) JsonObject(com.google.gson.JsonObject) CreateCallVO(com.fanap.podchat.call.model.CreateCallVO) CreateCallThread(com.fanap.podchat.call.model.CreateCallThread)

Example 4 with CreateCallVO

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

the class CallAsyncRequestsManager method createCallRequestMessage.

public static String createCallRequestMessage(CallRequest request, String uniqueId) {
    CreateCallVO createCallVO = new CreateCallVO();
    createCallVO.setCreatorId(CoreConfig.userId);
    if (request.getSubjectId() <= 0)
        createCallVO.setInvitees(request.getInvitees());
    else
        createCallVO.setThreadId(request.getSubjectId());
    createCallVO.setType(request.getCallType());
    SendClientDTO sendClientDTO = new SendClientDTO();
    sendClientDTO.setVideo(request.getCallType() == CallType.Constants.VIDEO_CALL);
    sendClientDTO.setMute(false);
    sendClientDTO.setClientType(ClientType.Constants.ANDROID);
    JsonObject contentObj = (JsonObject) App.getGson().toJsonTree(createCallVO);
    JsonElement clientDtoObj = App.getGson().toJsonTree(sendClientDTO);
    contentObj.add("creatorClientDto", clientDtoObj);
    AsyncMessage message = new AsyncMessage();
    message.setContent(contentObj.toString());
    message.setType(ChatMessageType.Constants.CALL_REQUEST);
    message.setToken(CoreConfig.token);
    message.setTokenIssuer(CoreConfig.tokenIssuer);
    message.setUniqueId(uniqueId);
    JsonObject messageObj;
    if (Util.isNullOrEmpty(request.getInvitees())) {
        message.setSubjectId(request.getSubjectId());
        messageObj = (JsonObject) App.getGson().toJsonTree(message);
    } else {
        messageObj = (JsonObject) App.getGson().toJsonTree(message);
        messageObj.remove("subjectId");
    }
    return messageObj.toString();
}
Also used : SendClientDTO(com.fanap.podchat.call.model.SendClientDTO) JsonElement(com.google.gson.JsonElement) AsyncMessage(com.fanap.podchat.mainmodel.AsyncMessage) JsonObject(com.google.gson.JsonObject) CreateCallVO(com.fanap.podchat.call.model.CreateCallVO)

Aggregations

CreateCallVO (com.fanap.podchat.call.model.CreateCallVO)4 SendClientDTO (com.fanap.podchat.call.model.SendClientDTO)2 AsyncMessage (com.fanap.podchat.mainmodel.AsyncMessage)2 JsonElement (com.google.gson.JsonElement)2 JsonObject (com.google.gson.JsonObject)2 CreateCallThread (com.fanap.podchat.call.model.CreateCallThread)1