*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
@SuppressWarnings("unchecked")
public List<Notification> filterNotifications(Collection<? extends Notification> notifications, Sone currentSone) {
*/
@SuppressWarnings("unchecked")
public List<Notification> filterNotifications(Collection<? extends Notification> notifications, Sone currentSone) {
for (Notification notification : notifications) {
if (notification.getId().equals("new-sone-notification")) {
if ((currentSone != null) && !currentSone.getOptions().isShowNewSoneNotifications()) {
for (Notification notification : notifications) {
if (notification.getId().equals("new-sone-notification")) {
if ((currentSone != null) && !currentSone.getOptions().isShowNewSoneNotifications()) {
@Nonnull
private Optional<ListNotification<Post>> filterPostNotification(@Nonnull ListNotification<Post> postNotification,
@Nullable Sone currentSone) {
@Nonnull
private Optional<ListNotification<Post>> filterPostNotification(@Nonnull ListNotification<Post> postNotification,
@Nullable Sone currentSone) {
if (newPosts.isEmpty()) {
return Optional.absent();
}
if (newPosts.size() == postNotification.getElements().size()) {
return Optional.of(postNotification);
}
if (newPosts.isEmpty()) {
return Optional.absent();
}
if (newPosts.size() == postNotification.getElements().size()) {
return Optional.of(postNotification);
}
filteredNotification.setElements(newPosts);
filteredNotification.setLastUpdateTime(postNotification.getLastUpdatedTime());
return Optional.of(filteredNotification);
filteredNotification.setElements(newPosts);
filteredNotification.setLastUpdateTime(postNotification.getLastUpdatedTime());
return Optional.of(filteredNotification);
*/
private Optional<ListNotification<PostReply>> filterNewReplyNotification(ListNotification<PostReply> newReplyNotification,
@Nonnull Sone currentSone) {
*/
private Optional<ListNotification<PostReply>> filterNewReplyNotification(ListNotification<PostReply> newReplyNotification,
@Nonnull Sone currentSone) {
if (newReplies.isEmpty()) {
return Optional.absent();
}
if (newReplies.size() == newReplyNotification.getElements().size()) {
return Optional.of(newReplyNotification);
}
if (newReplies.isEmpty()) {
return Optional.absent();
}
if (newReplies.size() == newReplyNotification.getElements().size()) {
return Optional.of(newReplyNotification);
}
filteredNotification.setElements(newReplies);
filteredNotification.setLastUpdateTime(newReplyNotification.getLastUpdatedTime());
return Optional.of(filteredNotification);
filteredNotification.setElements(newReplies);
filteredNotification.setLastUpdateTime(newReplyNotification.getLastUpdatedTime());
return Optional.of(filteredNotification);