use of com.fanap.podchat.call.result_model.GetCallHistoryResult in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnGetCallHistory.
public static ChatResponse<GetCallHistoryResult> handleOnGetCallHistory(ChatMessage chatMessage, Callback callback) {
ChatResponse<GetCallHistoryResult> 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 GetCallHistoryResult(calls, chatMessage.getContentCount(), (calls.size() + offset < chatMessage.getContentCount()), (calls.size() + offset)));
return response;
}
use of com.fanap.podchat.call.result_model.GetCallHistoryResult in project pod-chat-android-sdk by FanapSoft.
the class CallAsyncRequestsManager method handleOnGetCallHistoryFromCache.
public static ChatResponse<GetCallHistoryResult> handleOnGetCallHistoryFromCache(String uniqueId, ArrayList<CallVO> calls, long contentCount, long offset) {
ChatResponse<GetCallHistoryResult> response = new ChatResponse<>();
response.setUniqueId(uniqueId);
response.setResult(new GetCallHistoryResult(calls, contentCount, (calls.size() + offset < contentCount), (calls.size() + offset)));
response.setCache(true);
return response;
}
Aggregations