use of cx.ring.model.SecureSipCall in project ring-client-android by savoirfairelinux.
the class ConversationFacade method aggregateHistory.
private void aggregateHistory() {
Map<String, ArrayList<String>> conferences = mConferenceService.getConferenceList();
for (Map.Entry<String, ArrayList<String>> conferenceEntry : conferences.entrySet()) {
Conference conference = new Conference(conferenceEntry.getKey());
for (String callId : conferenceEntry.getValue()) {
SipCall call = getCall(callId).second;
if (call == null) {
call = new SipCall(callId, mCallService.getCallDetails(callId));
}
Account account = mAccountService.getAccount(call.getAccount());
if (account.isRing() || account.getDetailBoolean(ConfigKey.SRTP_ENABLE) || account.getDetailBoolean(ConfigKey.TLS_ENABLE)) {
call = new SecureSipCall(call, account.getDetail(ConfigKey.SRTP_KEY_EXCHANGE));
}
conference.addParticipant(call);
}
List<SipCall> calls = conference.getParticipants();
if (calls.size() == 1) {
SipCall call = calls.get(0);
CallContact contact = call.getContact();
if (call.getContact() == null) {
contact = mContactService.findContact(call.getNumberUri());
call.setContact(contact);
}
Conversation conv = null;
ArrayList<String> ids = contact.getIds();
for (String id : ids) {
conv = mConversationMap.get(id);
if (conv != null) {
break;
}
}
if (conv != null) {
conv.addConference(conference);
} else {
conv = new Conversation(contact);
conv.addConference(conference);
mConversationMap.put(ids.get(0), conv);
}
}
}
}
Aggregations