Search in sources :

Example 6 with ServiceEvent

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;
    });
}
Also used : Account(cx.ring.model.Account) ServiceEvent(cx.ring.model.ServiceEvent)

Example 7 with ServiceEvent

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);
}
Also used : ServiceEvent(cx.ring.model.ServiceEvent)

Example 8 with ServiceEvent

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);
}
Also used : ServiceEvent(cx.ring.model.ServiceEvent)

Example 9 with ServiceEvent

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);
}
Also used : Account(cx.ring.model.Account) ServiceEvent(cx.ring.model.ServiceEvent)

Example 10 with ServiceEvent

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);
}
Also used : ServiceEvent(cx.ring.model.ServiceEvent)

Aggregations

ServiceEvent (cx.ring.model.ServiceEvent)43 Account (cx.ring.model.Account)13 DataTransfer (cx.ring.model.DataTransfer)4 HistoryText (cx.ring.model.HistoryText)4 TextMessage (cx.ring.model.TextMessage)4 SQLException (java.sql.SQLException)4 SurfaceHolder (android.view.SurfaceHolder)3 CallContact (cx.ring.model.CallContact)3 Conversation (cx.ring.model.Conversation)3 HistoryCall (cx.ring.model.HistoryCall)3 SipCall (cx.ring.model.SipCall)3 Uri (cx.ring.model.Uri)3 IOException (java.io.IOException)3 Camera (android.hardware.Camera)2 StringMap (cx.ring.daemon.StringMap)2 DataTransferEventCode (cx.ring.model.DataTransferEventCode)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 Point (android.graphics.Point)1 DataTransferInfo (cx.ring.daemon.DataTransferInfo)1