public void linkContact(Contact c, long contactId) { if (Preferences.isContactLinkCloudStorageEnabled()) { Log.e(this.toString(), "Saving a ContactLink to the cloud is not yet supported"); return; } Log.v( this.toString(), "Creating ContactLink from " + c.getTopic() + " to contactId " + contactId); ContactLink cl = new ContactLink(c.getTopic(), contactId); App.getContactLinkDao().insertOrReplace(cl); updateContact(c); EventBus.getDefault().postSticky(new Events.ContactUpdated(c)); }
public long getContactIdFromLocalStorage(Contact c) { ContactLink cl = App.getContactLinkDao().load(c.getTopic()); return cl != null ? cl.getContactId() : 0; }