Search in sources :

Example 31 with CallContact

use of cx.ring.model.CallContact in project ring-client-android by savoirfairelinux.

the class ContactService method getContacts.

private Collection<CallContact> getContacts() {
    List<CallContact> contacts = new ArrayList<>(mContactList.values());
    List<CallContact> contactsRing = new ArrayList<>(mContactsRing.values());
    for (CallContact contact : contacts) {
        if (!contactsRing.contains(contact)) {
            contactsRing.add(contact);
        }
    }
    return contactsRing;
}
Also used : ArrayList(java.util.ArrayList) CallContact(cx.ring.model.CallContact)

Example 32 with CallContact

use of cx.ring.model.CallContact in project ring-client-android by savoirfairelinux.

the class ContactService method setRingContactName.

public boolean setRingContactName(String accountId, Uri uri, String name) {
    if (!accountId.equals(mAccountId)) {
        return false;
    }
    Log.w(TAG, "setRingContactName " + uri + " " + name);
    CallContact contact = findContact(uri);
    if (contact != null) {
        contact.setUsername(name);
        return true;
    }
    return false;
}
Also used : CallContact(cx.ring.model.CallContact)

Example 33 with CallContact

use of cx.ring.model.CallContact in project ring-client-android by savoirfairelinux.

the class SmartListPresenter method deleteConversation.

public void deleteConversation(SmartListViewModel smartListViewModel) {
    CallContact callContact = mContactService.getContact(new Uri(smartListViewModel.getUuid()));
    getView().displayDeleteDialog(callContact);
}
Also used : Uri(cx.ring.model.Uri) CallContact(cx.ring.model.CallContact)

Example 34 with CallContact

use of cx.ring.model.CallContact in project ring-client-android by savoirfairelinux.

the class SmartListPresenter method copyNumber.

public void copyNumber(SmartListViewModel smartListViewModel) {
    CallContact callContact = mContactService.getContact(new Uri(smartListViewModel.getUuid()));
    getView().copyNumber(callContact);
}
Also used : Uri(cx.ring.model.Uri) CallContact(cx.ring.model.CallContact)

Example 35 with CallContact

use of cx.ring.model.CallContact in project ring-client-android by savoirfairelinux.

the class MainPresenter method refreshContact.

private void refreshContact(String buddy) {
    for (int i = 0; i < mTvListViewModels.size(); i++) {
        TVListViewModel tvListViewModel = mTvListViewModels.get(i);
        CallContact callContact = tvListViewModel.getCallContact();
        if (callContact.getIds().get(0).equals("ring:" + buddy)) {
            TVListViewModel updatedTvListViewModel = new TVListViewModel(callContact, mPresenceService.isBuddyOnline(callContact.getIds().get(0)));
            if (!updatedTvListViewModel.equals(tvListViewModel)) {
                getView().refreshContact(i, updatedTvListViewModel);
            }
        }
    }
}
Also used : TVListViewModel(cx.ring.tv.model.TVListViewModel) CallContact(cx.ring.model.CallContact)

Aggregations

CallContact (cx.ring.model.CallContact)38 Conversation (cx.ring.model.Conversation)9 Uri (cx.ring.model.Uri)8 Account (cx.ring.model.Account)7 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)5 ContentResolver (android.content.ContentResolver)4 Cursor (android.database.Cursor)4 SipCall (cx.ring.model.SipCall)4 ServiceEvent (cx.ring.model.ServiceEvent)3 Settings (cx.ring.model.Settings)3 TextMessage (cx.ring.model.TextMessage)3 IOException (java.io.IOException)3 Map (java.util.Map)3 Intent (android.content.Intent)2 StringMap (cx.ring.daemon.StringMap)2 TrustRequest (cx.ring.model.TrustRequest)2 TVListViewModel (cx.ring.tv.model.TVListViewModel)2 List (java.util.List)2 PendingIntent (android.app.PendingIntent)1