use of com.fanap.podchat.call.model.CallVO in project pod-chat-android-sdk by FanapSoft.
the class CacheCall method toCallVo.
public CallVO toCallVo() {
CallVO callVO = new CallVO();
callVO.setPartnerParticipantVO(this.partnerParticipantVO);
callVO.setCallParticipants(this.callParticipants);
callVO.setCreateTime(this.createTime);
callVO.setCreatorId(this.creatorId);
callVO.setEndTime(this.endTime);
callVO.setGroup(this.isGroup);
callVO.setType(this.type);
callVO.setId(this.id);
callVO.setStartTime(this.startTime);
callVO.setStatus(this.status);
return callVO;
}
use of com.fanap.podchat.call.model.CallVO 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.model.CallVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onReceiveCallHistory.
@Override
public void onReceiveCallHistory(ChatResponse<GetCallHistoryResult> response) {
List<CallWrapper> calls = new ArrayList<>();
for (CallVO call : response.getResult().getCallsList()) {
if (call.getPartnerParticipantVO() != null || call.getConversationVO() != null) {
CallWrapper callWrapper = CallWrapper.fromCall(call);
callWrapper.setCallItemType(CallWrapper.CallItemType.HISTORY);
calls.add(callWrapper);
}
}
if (callsList.size() > 0) {
calls.removeAll(callsList);
}
callsList.addAll(calls);
view.onGetCallHistory(calls);
}
use of com.fanap.podchat.call.model.CallVO in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onReceiveActiveCalls.
@Override
public void onReceiveActiveCalls(ChatResponse<GetActiveCallsResult> response) {
List<CallWrapper> calls = new ArrayList<>();
for (CallVO call : response.getResult().getCallsList()) {
if (call.getPartnerParticipantVO() != null || call.getConversationVO() != null) {
CallWrapper callWrapper = CallWrapper.fromCall(call);
callWrapper.setCallItemType(CallWrapper.CallItemType.ACTIVE);
calls.add(callWrapper);
}
}
calls.removeAll(callsList);
callsList.addAll(calls);
if (calls.size() > 0) {
view.onGetActiveCalls(calls);
}
}
use of com.fanap.podchat.call.model.CallVO 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