use of com.vodafone360.people.datatypes.PushAvailabilityEvent in project 360-Engine-for-Android by 360.
the class PresenceEngine method handlePushEvent.
private void handlePushEvent(PushEvent event) {
switch(event.mMessageType) {
case AVAILABILITY_STATE_CHANGE:
PushAvailabilityEvent pa = (PushAvailabilityEvent) event;
updatePresenceDatabase(pa.mChanges);
break;
case CHAT_MESSAGE:
PushChatMessageEvent pc = (PushChatMessageEvent) event;
// update the DB with an incoming message
updateChatDatabase(pc.getChatMsg(), TimelineSummaryItem.Type.INCOMING);
break;
case CLOSED_CONVERSATION:
PushClosedConversationEvent pcc = (PushClosedConversationEvent) event;
// delete the conversation in DB
if (pcc.getConversation() != null) {
ChatDbUtils.deleteConversationById(pcc.getConversation(), mDbHelper);
}
break;
default:
LogUtils.logE("PresenceEngine.handleServerResponse():" + " push message type was not recognized:" + event.getType());
}
}
Aggregations