Search in sources :

Example 41 with ServiceEvent

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

the class PresenceService method newServerSubscriptionRequest.

public void newServerSubscriptionRequest(String remote) {
    Log.d(TAG, "newServerSubscriptionRequest: " + remote);
    setChanged();
    ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.NEW_SERVER_SUBSCRIPTION_REQUEST);
    event.addEventInput(ServiceEvent.EventInput.REMOTE, remote);
    notifyObservers(event);
}
Also used : ServiceEvent(cx.ring.model.ServiceEvent)

Example 42 with ServiceEvent

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

the class PresenceService method subscriptionStateChanged.

public void subscriptionStateChanged(String accountId, String buddyUri, int state) {
    Log.d(TAG, "subscriptionStateChanged: " + accountId + ", " + buddyUri + ", " + state);
    setChanged();
    ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.SUBSCRIPTION_STATE_CHANGED);
    event.addEventInput(ServiceEvent.EventInput.ACCOUNT_ID, accountId);
    event.addEventInput(ServiceEvent.EventInput.BUDDY_URI, buddyUri);
    event.addEventInput(ServiceEvent.EventInput.STATE, state);
    notifyObservers(event);
}
Also used : ServiceEvent(cx.ring.model.ServiceEvent)

Example 43 with ServiceEvent

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

the class ConversationFacade method startConversation.

/**
 * @return the started new conversation
 */
public Conversation startConversation(CallContact contact) {
    Conversation conversation = getConversationByContact(contact);
    if (conversation == null) {
        conversation = new Conversation(contact);
        mConversationMap.put(contact.getIds().get(0), conversation);
        Account account = mAccountService.getCurrentAccount();
        if (account != null && account.isRing()) {
            Uri number = contact.getPhones().get(0).getNumber();
            if (number.isRingId()) {
                mAccountService.lookupAddress(account.getAccountID(), "", number.getRawRingId());
            }
        }
        setChanged();
        ServiceEvent event = new ServiceEvent(ServiceEvent.EventType.CONVERSATIONS_CHANGED);
        notifyObservers(event);
        updateTextNotifications();
    }
    return conversation;
}
Also used : Account(cx.ring.model.Account) ServiceEvent(cx.ring.model.ServiceEvent) Conversation(cx.ring.model.Conversation) Uri(cx.ring.model.Uri)

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