use of com.fanap.podchat.call.history.CallWrapper in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method removeActiveCallIfExist.
private void removeActiveCallIfExist(long endedCallId) {
CallWrapper endedCallInList = null;
for (CallWrapper callItem : callsList) {
if (callItem.getId() == endedCallId) {
endedCallInList = callItem;
break;
}
}
if (endedCallInList != null) {
view.removeCallItem(endedCallInList);
endedCallInList.setCallItemType(CallWrapper.CallItemType.HISTORY);
view.onGetCallHistory(Collections.singletonList(endedCallInList));
}
}
use of com.fanap.podchat.call.history.CallWrapper 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.history.CallWrapper 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);
}
}
Aggregations