use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnCallEnded.
public static ChatResponse<EndCallResult> handleOnCallEnded(ChatMessage chatMessage) {
ChatResponse<EndCallResult> response = new ChatResponse<>();
EndCallResult result = new EndCallResult();
result.setTypeCode(chatMessage.getTypeCode());
result.setCallId(chatMessage.getSubjectId());
response.setResult(result);
response.setSubjectId(chatMessage.getSubjectId());
response.setUniqueId(chatMessage.getUniqueId());
return response;
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnParticipantRemoved.
public static ChatResponse<RemoveFromCallResult> handleOnParticipantRemoved(ChatMessage chatMessage) {
ChatResponse<RemoveFromCallResult> response = new ChatResponse<>();
ArrayList<CallParticipantVO> participantsLeft = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<CallParticipantVO>>() {
}.getType());
RemoveFromCallResult result = new RemoveFromCallResult();
result.setCallId(chatMessage.getSubjectId());
result.setCallParticipants(participantsLeft);
if (Util.isNotNullOrEmpty(participantsLeft))
result.setUserRemoved(isUserContains(participantsLeft));
response.setResult(result);
response.setSubjectId(chatMessage.getSubjectId());
response.setUniqueId(chatMessage.getUniqueId());
return response;
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleStartedRecordCallResponse.
public static ChatResponse<Participant> handleStartedRecordCallResponse(ChatMessage chatMessage) {
ChatResponse<Participant> response = new ChatResponse<>();
Participant result = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<Participant>() {
}.getType());
response.setResult(result);
response.setUniqueId(chatMessage.getUniqueId());
response.setCache(false);
return response;
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnCallCanceled.
public static ChatResponse<CallCancelResult> handleOnCallCanceled(ChatMessage chatMessage) {
ChatResponse<CallCancelResult> response = new ChatResponse<>();
try {
CallParticipantVO participantVO = App.getGson().fromJson(chatMessage.getContent(), CallParticipantVO.class);
CallCancelResult result = new CallCancelResult(participantVO);
response.setResult(result);
response.setHasError(false);
response.setUniqueId(chatMessage.getUniqueId());
response.setSubjectId(chatMessage.getSubjectId());
response.setCache(false);
return response;
} catch (Exception e) {
e.printStackTrace();
response.setCache(false);
response.setHasError(true);
response.setUniqueId(chatMessage.getUniqueId());
response.setSubjectId(chatMessage.getSubjectId());
response.setErrorCode(ChatConstant.ERROR_CODE_INVALID_DATA);
response.setErrorMessage(ChatConstant.ERROR_INVALID_DATA);
return response;
}
}
use of com.fanap.podchat.model.ChatResponse in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnRejectCallRequest.
public static ChatResponse<CallRequestResult> handleOnRejectCallRequest(ChatMessage chatMessage) {
CallRequestResult callRequestResult = App.getGson().fromJson(chatMessage.getContent(), CallRequestResult.class);
callRequestResult.setThreadId(chatMessage.getSubjectId());
ChatResponse<CallRequestResult> response = new ChatResponse<>();
response.setResult(callRequestResult);
response.setUniqueId(chatMessage.getUniqueId());
response.setSubjectId(chatMessage.getSubjectId());
return response;
}
Aggregations