/** * This method will be called when a conversation is posted to the EventBus. * * @param conversation The bus event containing a conversation object. */ public void onEvent(Conversation conversation) { // Unregister this instance. For new push messages the new instance will be registered in // onCreate(). EventBus.getDefault().unregister(this); Log.d(TAG, "EventBus:" + conversation.toString()); GroupDatabaseManager groupDBM = new GroupDatabaseManager(getApplicationContext()); groupDBM.updateConversation(conversation); groupDBM.setGroupNewEvents(pushMessage.getId1(), true); NotificationSettings notificationSettings = settingsDBM.getGroupNotificationSettings(pushMessage.getId1()); if (notificationSettings == NotificationSettings.GENERAL) { notificationSettings = settingsDBM.getSettings().getNotificationSettings(); } if (notificationSettings.equals(NotificationSettings.ALL)) { sendConversationNotification(pushMessage.getId1()); } else if (notificationSettings.equals(NotificationSettings.PRIORITY)) { if (pushMessage.getPushType().equals(PushType.CONVERSATION_NEW)) { sendConversationNotification(pushMessage.getId1()); } } }