use of cx.ring.model.ServiceEvent in project ring-client-android by savoirfairelinux.
the class AccountService method acceptTrustRequest.
/**
* Accepts a pending trust request
*/
public Boolean acceptTrustRequest(final String accountId, final String from) {
Account account = getAccount(accountId);
account.removeRequest(from);
return FutureUtils.executeDaemonThreadCallable(mExecutor, mDeviceRuntimeService.provideDaemonThreadId(), false, () -> {
Log.i(TAG, "acceptTrustRequest() thread running...");
boolean ok = Ringservice.acceptTrustRequest(accountId, from);
if (ok) {
ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.INCOMING_TRUST_REQUEST);
event.addEventInput(ServiceEvent.EventInput.ACCOUNT_ID, accountId);
notifyObservers(event);
}
return ok;
});
}
use of cx.ring.model.ServiceEvent in project ring-client-android by savoirfairelinux.
the class AccountService method stunStatusFailure.
public void stunStatusFailure(String accountId) {
Log.d(TAG, "stun status failure: " + accountId);
setChanged();
ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.STUN_STATUS_FAILURE);
event.addEventInput(ServiceEvent.EventInput.ACCOUNT_ID, accountId);
notifyObservers(event);
}
use of cx.ring.model.ServiceEvent in project ring-client-android by savoirfairelinux.
the class AccountService method accountMessageStatusChanged.
public void accountMessageStatusChanged(String accountId, long messageId, String to, int status) {
Log.d(TAG, "accountMessageStatusChanged: " + accountId + ", " + messageId + ", " + to + ", " + status);
setChanged();
ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.ACCOUNT_MESSAGE_STATUS_CHANGED);
event.addEventInput(ServiceEvent.EventInput.ACCOUNT_ID, accountId);
event.addEventInput(ServiceEvent.EventInput.MESSAGE_ID, messageId);
event.addEventInput(ServiceEvent.EventInput.TO, to);
event.addEventInput(ServiceEvent.EventInput.STATE, status);
notifyObservers(event);
}
use of cx.ring.model.ServiceEvent in project ring-client-android by savoirfairelinux.
the class AccountService method nameRegistrationEnded.
public void nameRegistrationEnded(String accountId, int state, String name) {
Log.d(TAG, "nameRegistrationEnded: " + accountId + ", " + state + ", " + name);
Account acc = getAccount(accountId);
if (acc == null) {
Log.w(TAG, "Can't find account for name registration callback");
return;
}
acc.registeringUsername = false;
acc.setVolatileDetails(getVolatileAccountDetails(acc.getAccountID()));
acc.setDetail(ConfigKey.ACCOUNT_REGISTERED_NAME, name);
setChanged();
ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.NAME_REGISTRATION_ENDED);
event.addEventInput(ServiceEvent.EventInput.ACCOUNT_ID, accountId);
event.addEventInput(ServiceEvent.EventInput.STATE, state);
event.addEventInput(ServiceEvent.EventInput.NAME, name);
notifyObservers(event);
}
use of cx.ring.model.ServiceEvent in project ring-client-android by savoirfairelinux.
the class AccountService method deviceRevocationEnded.
public void deviceRevocationEnded(String accountId, String device, int state) {
Log.d(TAG, "deviceRevocationEnded: " + accountId + ", " + device + ", " + state);
setChanged();
ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.DEVICE_REVOCATION_ENDED);
event.addEventInput(ServiceEvent.EventInput.ACCOUNT_ID, accountId);
event.addEventInput(ServiceEvent.EventInput.DEVICE, device);
event.addEventInput(ServiceEvent.EventInput.STATE, state);
notifyObservers(event);
}
Aggregations