use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.
the class SharePresenter method loadContactInformation.
public void loadContactInformation() {
if (getView() == null) {
return;
}
// ask for the current account
Account currentAccount = mAccountService.getCurrentAccount();
// let the view display the ViewModel
getView().showViewModel(new ShareViewModel(currentAccount));
}
use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.
the class SmartListPresenter method loadConversations.
private void loadConversations() {
if (mAccountService.getCurrentAccount() == null) {
Log.w(TAG, "loadConversations: Not able to get current account");
return;
}
getView().setLoading(true);
Account currentAccount = mAccountService.getCurrentAccount();
if (currentAccount == null) {
Log.e(TAG, "loadConversations: Not able to get currentAccount");
return;
}
if (currentAccount.isSip()) {
loadContacts();
} else {
loadHistory();
}
}
use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.
the class SmartListPresenter method queryTextChanged.
public void queryTextChanged(String query) {
if (query.equals("")) {
getView().hideSearchRow();
getView().setLoading(false);
} else {
Account currentAccount = mAccountService.getCurrentAccount();
if (currentAccount == null) {
return;
}
if (currentAccount.isSip()) {
// sip search
mCallContact = CallContact.buildUnknown(query, null);
getView().displayContact(mCallContact);
} else {
Uri uri = new Uri(query);
if (uri.isRingId()) {
mCallContact = CallContact.buildUnknown(uri);
getView().displayContact(mCallContact);
} else {
getView().hideSearchRow();
// Ring search
if (mNameLookupInputHandler == null) {
mNameLookupInputHandler = new NameLookupInputHandler(mAccountService, currentAccount.getAccountID());
}
mLastBlockchainQuery = query;
mNameLookupInputHandler.enqueueNextLookup(query);
getView().setLoading(true);
}
}
}
getView().updateList(filter(mSmartListViewModels, query));
}
use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.
the class RingNavigationViewModel method getVcard.
public VCard getVcard(File filesDir) {
Account account = mAccount.get();
if (account == null) {
return null;
}
String accountId = isAccountValid() ? account.getAccountID() : null;
return VCardUtils.loadLocalProfileFromDisk(filesDir, accountId);
}
use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.
the class RingAccountSummaryPresenter method handleKnownDevices.
private void handleKnownDevices(ServiceEvent event) {
String accountId = event.getEventInput(ServiceEvent.EventInput.ACCOUNT_ID, String.class);
Account currentAccount = mAccountService.getAccount(mAccountID);
if (currentAccount == null || !mAccountID.equals(accountId) || getView() == null) {
return;
}
final StringMap devices = event.getEventInput(ServiceEvent.EventInput.DEVICES, StringMap.class);
getView().updateDeviceList(devices.toNative(), currentAccount.getDeviceId());
}
Aggregations