use of com.fanap.podchat.call.result_model.GetActiveCallsResult in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnGetActiveCalls.
public static ChatResponse<GetActiveCallsResult> handleOnGetActiveCalls(ChatMessage chatMessage, Callback callback) {
ChatResponse<GetActiveCallsResult> response = new ChatResponse<>();
response.setUniqueId(chatMessage.getUniqueId());
ArrayList<CallVO> calls = new ArrayList<>();
long offset = callback != null ? callback.getOffset() : 0;
try {
calls = App.getGson().fromJson(chatMessage.getContent(), new TypeToken<ArrayList<CallVO>>() {
}.getType());
} catch (JsonSyntaxException ignored) {
}
response.setResult(new GetActiveCallsResult(calls, chatMessage.getContentCount(), (calls.size() + offset < chatMessage.getContentCount()), (calls.size() + offset)));
return response;
}
Aggregations