- private static JsonObject createJsonOptions(Sone currentSone) {
- JsonObject options = new JsonObject();
- if (currentSone != null) {
- options.put("ShowNotification/NewSones", currentSone.getOptions().getBooleanOption("ShowNotification/NewSones").get());
- options.put("ShowNotification/NewPosts", currentSone.getOptions().getBooleanOption("ShowNotification/NewPosts").get());
- options.put("ShowNotification/NewReplies", currentSone.getOptions().getBooleanOption("ShowNotification/NewReplies").get());
+ private static JsonNode createJsonOptions(Optional<Sone> currentSone) {
+ ObjectNode options = new ObjectNode(instance);
+ if (currentSone.isPresent()) {
+ options.put("ShowNotification/NewSones", currentSone.get().getOptions().isShowNewSoneNotifications());
+ options.put("ShowNotification/NewPosts", currentSone.get().getOptions().isShowNewPostNotifications());
+ options.put("ShowNotification/NewReplies", currentSone.get().getOptions().isShowNewReplyNotifications());