use of com.fanap.podchat.call.result_model.GetCallParticipantResult in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method reformatActiveCallParticipant.
public static ChatResponse<GetCallParticipantResult> reformatActiveCallParticipant(ChatMessage chatMessage) {
try {
ArrayList<CallParticipantVO> callParticipantVOS = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<CallParticipantVO>>() {
}.getType());
ChatResponse<GetCallParticipantResult> response = new ChatResponse<>();
GetCallParticipantResult result = new GetCallParticipantResult(callParticipantVOS);
result.setThreadId(chatMessage.getSubjectId());
response.setResult(result);
response.setSubjectId(chatMessage.getSubjectId());
response.setUniqueId(chatMessage.getUniqueId());
response.setCache(false);
response.setHasError(false);
return response;
} catch (Exception e) {
e.printStackTrace();
ChatResponse<GetCallParticipantResult> response = new ChatResponse<>();
response.setErrorMessage(e.getMessage());
response.setErrorCode(ChatConstant.ERROR_CODE_UNKNOWN_EXCEPTION);
response.setHasError(true);
return response;
}
}
Aggregations