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);
}
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);
}
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;
}
Aggregations