projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Actually delete the reply.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
notify
/
ListNotificationFilters.java
diff --git
a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
index
1881a1b
..
f431bb7
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
+++ b/
src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java
@@
-31,6
+31,8
@@
import net.pterodactylus.sone.freenet.wot.OwnIdentity;
import net.pterodactylus.sone.freenet.wot.Trust;
import net.pterodactylus.util.notify.Notification;
import net.pterodactylus.sone.freenet.wot.Trust;
import net.pterodactylus.util.notify.Notification;
+import com.google.common.base.Optional;
+
/**
* Filter for {@link ListNotification}s.
*
/**
* Filter for {@link ListNotification}s.
*
@@
-241,9
+243,8
@@
public class ListNotificationFilters {
* received trust values. to prevent this we simply assume that
* posts are visible if there is no trust.
*/
* received trust values. to prevent this we simply assume that
* posts are visible if there is no trust.
*/
- return true;
}
}
- if ((!postSone.equals(sone)) && !sone.hasFriend(postSone.getId()) && !sone.
equals(post.getRecipient
())) {
+ if ((!postSone.equals(sone)) && !sone.hasFriend(postSone.getId()) && !sone.
getId().equals(post.getRecipientId().orNull
())) {
return false;
}
}
return false;
}
}
@@
-282,11
+283,11
@@
public class ListNotificationFilters {
*/
public static boolean isReplyVisible(Sone sone, PostReply reply) {
checkNotNull(reply, "reply must not be null");
*/
public static boolean isReplyVisible(Sone sone, PostReply reply) {
checkNotNull(reply, "reply must not be null");
-
Post
post = reply.getPost();
- if (
post == null
) {
+
Optional<Post>
post = reply.getPost();
+ if (
!post.isPresent()
) {
return false;
}
return false;
}
- if (!isPostVisible(sone, post)) {
+ if (!isPostVisible(sone, post
.get()
)) {
return false;
}
if (reply.getTime() > System.currentTimeMillis()) {
return false;
}
if (reply.getTime() > System.currentTimeMillis()) {