import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.freenet.StringBucket;
+import net.pterodactylus.sone.main.SonePlugin;
import net.pterodactylus.util.io.Closer;
import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.service.AbstractService;
/* check every seconds. */
sleep(1000);
+ /* don’t insert locked Sones. */
+ if (core.isLocked(sone)) {
+ /* trigger redetection when the Sone is unlocked. */
+ synchronized (sone) {
+ modified = !sone.getFingerprint().equals(lastInsertFingerprint);
+ }
+ lastFingerprint = "";
+ lastModificationTime = 0;
+ continue;
+ }
+
InsertInformation insertInformation = null;
synchronized (sone) {
String fingerprint = sone.getFingerprint();
soneProperties.put("posts", new ArrayList<Post>(sone.getPosts()));
soneProperties.put("replies", new HashSet<Reply>(sone.getReplies()));
soneProperties.put("likedPostIds", new HashSet<String>(sone.getLikedPostIds()));
- soneProperties.put("likeReplyIds", new HashSet<String>(sone.getLikedReplyIds()));
+ soneProperties.put("likedReplyIds", new HashSet<String>(sone.getLikedReplyIds()));
}
//
}
template.set("currentSone", soneProperties);
+ template.set("version", SonePlugin.VERSION);
StringWriter writer = new StringWriter();
StringBucket bucket = null;
try {