import net.pterodactylus.sone.data.Profile;
import net.pterodactylus.sone.data.Profile.Field;
import net.pterodactylus.sone.data.Reply;
+import net.pterodactylus.sone.data.Reply.Modifier.ReplyUpdated;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Sone.ShowCustomAvatars;
import net.pterodactylus.sone.data.Sone.SoneStatus;
continue;
}
if (reply.getTime() < getSoneFollowingTime(sone)) {
- reply.modify().setKnown().update();
+ reply.modify().setKnown().update(Optional.<ReplyUpdated<PostReply>>absent());
} else if (!reply.isKnown()) {
eventBus.post(new NewPostReplyFoundEvent(reply));
}
}
database.storePostReplies(sone, replies);
for (PostReply reply : replies) {
- reply.modify().setKnown().update();
+ reply.modify().setKnown().update(Optional.<ReplyUpdated<PostReply>>absent());
}
logger.info(String.format("Sone loaded successfully: %s", sone));
*/
public void markReplyKnown(PostReply reply) {
boolean previouslyKnown = reply.isKnown();
- reply.modify().setKnown().update();
- eventBus.post(new MarkPostReplyKnownEvent(reply));
+ reply.modify().setKnown().update(postReplyUpdated());
if (!previouslyKnown) {
touchConfiguration();
}
});
}
+ public Optional<ReplyUpdated<PostReply>> postReplyUpdated() {
+ return Optional.<ReplyUpdated<PostReply>>of(new ReplyUpdated<PostReply>() {
+ @Override
+ public void replyUpdated(PostReply reply) {
+ eventBus.post(new MarkPostReplyKnownEvent(reply));
+ }
+ });
+ }
+
public Optional<ImageCreated> imageCreated() {
return Optional.<ImageCreated>of(new ImageCreated() {
@Override