projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6163031
)
Remove method to mark replies as known from the core.
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Wed, 16 Oct 2013 19:44:49 +0000
(21:44 +0200)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:29 +0000
(22:25 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/web/WebInterface.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/sone/core/Core.java
b/src/main/java/net/pterodactylus/sone/core/Core.java
index
af81054
..
fbcc8b3
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/Core.java
+++ b/
src/main/java/net/pterodactylus/sone/core/Core.java
@@
-62,7
+62,6
@@
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.PostReply;
import net.pterodactylus.sone.data.Profile;
import net.pterodactylus.sone.data.Profile.Field;
import net.pterodactylus.sone.data.PostReply;
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.Reply.Modifier.ReplyUpdated;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Sone.ShowCustomAvatars;
@@
-678,7
+677,7
@@
public class Core extends AbstractService implements SoneProvider {
}
for (PostReply reply : followedSone.get().getReplies()) {
if (reply.getTime() < now) {
}
for (PostReply reply : followedSone.get().getReplies()) {
if (reply.getTime() < now) {
-
markReplyKnown(reply
);
+
reply.modify().setKnown().update(Optional.<ReplyUpdated<PostReply>>absent()
);
}
}
}
}
}
}
@@
-1170,7
+1169,7
@@
public class Core extends AbstractService implements SoneProvider {
eventBus.post(new MarkPostKnownEvent(post));
touchConfiguration();
for (PostReply reply : post.getReplies()) {
eventBus.post(new MarkPostKnownEvent(post));
touchConfiguration();
for (PostReply reply : post.getReplies()) {
-
markReplyKnown(reply
);
+
reply.modify().setKnown().update(postReplyUpdated()
);
}
}
}
}
@@
-1220,28
+1219,12
@@
public class Core extends AbstractService implements SoneProvider {
logger.log(Level.FINE, String.format("Tried to delete non-local reply: %s", reply));
return;
}
logger.log(Level.FINE, String.format("Tried to delete non-local reply: %s", reply));
return;
}
+ postReplyUpdated().get().replyUpdated(reply);
database.removePostReply(reply);
database.removePostReply(reply);
- markReplyKnown(reply);
- sone.removeReply(reply);
touchConfiguration();
}
/**
touchConfiguration();
}
/**
- * Marks the given reply as known, if it is currently not a known reply
- * (according to {@link Reply#isKnown()}).
- *
- * @param reply
- * The reply to mark as known
- */
- public void markReplyKnown(PostReply reply) {
- boolean previouslyKnown = reply.isKnown();
- reply.modify().setKnown().update(postReplyUpdated());
- if (!previouslyKnown) {
- touchConfiguration();
- }
- }
-
- /**
* Creates a new image.
*
* @param sone
* Creates a new image.
*
* @param sone
@@
-1844,7
+1827,7
@@
public class Core extends AbstractService implements SoneProvider {
*/
@Override
public void run() {
*/
@Override
public void run() {
-
markReplyKnown
(postReply);
+
postReplyUpdated().get().replyUpdated
(postReply);
}
}, 10, TimeUnit.SECONDS);
}
}
}, 10, TimeUnit.SECONDS);
}
diff --git
a/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java
b/src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java
index
98984dd
..
59bcf2e
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/MarkAsKnownPage.java
@@
-74,7
+74,7
@@
public class MarkAsKnownPage extends SoneTemplatePage {
if (!reply.isPresent()) {
continue;
}
if (!reply.isPresent()) {
continue;
}
-
webInterface.getCore().markReplyKnown(reply.get
());
+
reply.get().modify().setKnown().update(webInterface.getCore().postReplyUpdated
());
} else if (type.equals("sone")) {
Optional<Sone> sone = webInterface.getCore().getSone(id);
if (!sone.isPresent()) {
} else if (type.equals("sone")) {
Optional<Sone> sone = webInterface.getCore().getSone(id);
if (!sone.isPresent()) {
diff --git
a/src/main/java/net/pterodactylus/sone/web/WebInterface.java
b/src/main/java/net/pterodactylus/sone/web/WebInterface.java
index
a72dcd5
..
ea1cb83
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/WebInterface.java
+++ b/
src/main/java/net/pterodactylus/sone/web/WebInterface.java
@@
-862,7
+862,7
@@
public class WebInterface {
notificationManager.addNotification(mentionNotification);
}
} else {
notificationManager.addNotification(mentionNotification);
}
} else {
-
getCore().markReplyKnown(reply
);
+
reply.modify().setKnown().update(getCore().postReplyUpdated()
);
}
}
}
}
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
index
f79f42e
..
fb602db
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/MarkAsKnownAjaxPage.java
@@
-65,7
+65,7
@@
public class MarkAsKnownAjaxPage extends JsonPage {
if (!reply.isPresent()) {
continue;
}
if (!reply.isPresent()) {
continue;
}
-
core.markReplyKnown(reply.get
());
+
reply.get().modify().setKnown().update(webInterface.getCore().postReplyUpdated
());
} else if (type.equals("sone")) {
Optional<Sone> sone = core.getSone(id);
if (!sone.isPresent()) {
} else if (type.equals("sone")) {
Optional<Sone> sone = core.getSone(id);
if (!sone.isPresent()) {