use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createEndRecordCall.
public static String createEndRecordCall(StartOrEndCallRecordRequest request, String uniqueId) {
AsyncMessage message = new AsyncMessage();
message.setType(ChatMessageType.Constants.END_RECORD_CALL);
message.setToken(CoreConfig.token);
message.setSubjectId(request.getCallId());
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
JsonObject a = (JsonObject) App.getGson().toJsonTree(message);
return a.toString();
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createAcceptCallRequest.
public static String createAcceptCallRequest(AcceptCallRequest request, String uniqueId) {
AsyncMessage message = new AsyncMessage();
SendClientDTO sendClientDTO = new SendClientDTO();
sendClientDTO.setVideo(request.isVideoCall());
sendClientDTO.setMute(request.isMute());
sendClientDTO.setClientType(ClientType.Constants.ANDROID);
JsonElement clientDtoObj = App.getGson().toJsonTree(sendClientDTO);
message.setContent(clientDtoObj.toString());
message.setType(ChatMessageType.Constants.ACCEPT_CALL);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setSubjectId(request.getCallId());
message.setUniqueId(uniqueId);
JsonObject messageObj = (JsonObject) App.getGson().toJsonTree(message);
return messageObj.toString();
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createTurnOnVideoMessage.
public static String createTurnOnVideoMessage(long callId, String uniqueId) {
ArrayList<Long> ids = new ArrayList<>();
ids.add(CoreConfig.userId);
TurnCallParticipantVideoOffRequest request = new TurnCallParticipantVideoOffRequest.Builder(callId, ids).build();
AsyncMessage message = new AsyncMessage();
message.setType(ChatMessageType.Constants.TURN_ON_VIDEO_CALL);
message.setToken(CoreConfig.token);
message.setSubjectId(request.getCallId());
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? request.getTypeCode() : CoreConfig.typeCode);
JsonObject a = (JsonObject) App.getGson().toJsonTree(message);
return a.toString();
}
use of com.fanap.podchat.mainmodel.AsyncMessage 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();
}
use of com.fanap.podchat.mainmodel.AsyncMessage in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method createGetCallHistoryRequest.
public static String createGetCallHistoryRequest(GetCallHistoryRequest request, String uniqueId) {
request.setCount(request.getCount() > 0 ? request.getCount() : 50);
JsonObject content = (JsonObject) App.getGson().toJsonTree(request);
if (request.getCreatorSsoId() == 0)
content.remove("creatorSsoId");
if (request.getCreatorCoreUserId() == 0)
content.remove("creatorCoreUserId");
if (request.getThreadId() == null || request.getThreadId() <= 0)
content.remove("threadId");
content.remove("useCache");
AsyncMessage message = new AsyncMessage();
message.setContent(content.toString());
message.setType(ChatMessageType.Constants.GET_CALLS);
message.setToken(CoreConfig.token);
message.setTokenIssuer(CoreConfig.tokenIssuer);
message.setUniqueId(uniqueId);
message.setTypeCode(Util.isNullOrEmpty(request.getTypeCode()) ? CoreConfig.typeCode : request.getTypeCode());
JsonObject jsonObject = (JsonObject) App.getGson().toJsonTree(message);
jsonObject.remove("subjectId");
return jsonObject.toString();
}
Aggregations