projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7bf3f34
)
Return ID of the post from post reply.
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Thu, 24 Jan 2013 06:42:08 +0000
(07:42 +0100)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Thu, 24 Jan 2013 06:42:08 +0000
(07:42 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/data/PostReply.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/data/impl/PostReplyImpl.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/web/SearchPage.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.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
9bc31bb
..
33e57c7
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/Core.java
+++ b/
src/main/java/net/pterodactylus/sone/core/Core.java
@@
-2008,7
+2008,7
@@
public class Core extends AbstractService implements SoneProvider, PostProvider,
for (PostReply reply : sone.getReplies()) {
String replyPrefix = sonePrefix + "/Replies/" + replyCounter++;
configuration.getStringValue(replyPrefix + "/ID").setValue(reply.getId());
for (PostReply reply : sone.getReplies()) {
String replyPrefix = sonePrefix + "/Replies/" + replyCounter++;
configuration.getStringValue(replyPrefix + "/ID").setValue(reply.getId());
- configuration.getStringValue(replyPrefix + "/Post/ID").setValue(reply.getPost
().get
Id());
+ configuration.getStringValue(replyPrefix + "/Post/ID").setValue(reply.getPostId());
configuration.getLongValue(replyPrefix + "/Time").setValue(reply.getTime());
configuration.getStringValue(replyPrefix + "/Text").setValue(reply.getText());
}
configuration.getLongValue(replyPrefix + "/Time").setValue(reply.getTime());
configuration.getStringValue(replyPrefix + "/Text").setValue(reply.getText());
}
diff --git
a/src/main/java/net/pterodactylus/sone/data/PostReply.java
b/src/main/java/net/pterodactylus/sone/data/PostReply.java
index
4452e2e
..
8dc6f93
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/PostReply.java
+++ b/
src/main/java/net/pterodactylus/sone/data/PostReply.java
@@
-26,6
+26,13
@@
package net.pterodactylus.sone.data;
public interface PostReply extends Reply<PostReply> {
/**
public interface PostReply extends Reply<PostReply> {
/**
+ * Returns the ID of the post this reply refers to.
+ *
+ * @return The ID of the post this reply refers to
+ */
+ public String getPostId();
+
+ /**
* Returns the post this reply refers to.
*
* @return The post this reply refers to
* Returns the post this reply refers to.
*
* @return The post this reply refers to
diff --git
a/src/main/java/net/pterodactylus/sone/data/impl/PostReplyImpl.java
b/src/main/java/net/pterodactylus/sone/data/impl/PostReplyImpl.java
index
017f019
..
fa6629e
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/impl/PostReplyImpl.java
+++ b/
src/main/java/net/pterodactylus/sone/data/impl/PostReplyImpl.java
@@
-53,6
+53,14
@@
public class PostReplyImpl extends ReplyImpl<PostReply> implements PostReply {
//
/**
//
/**
+ * {@inheritDocs}
+ */
+ @Override
+ public String getPostId() {
+ return postId;
+ }
+
+ /**
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
diff --git
a/src/main/java/net/pterodactylus/sone/web/SearchPage.java
b/src/main/java/net/pterodactylus/sone/web/SearchPage.java
index
b937b2f
..
6cb2c0c
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/SearchPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/SearchPage.java
@@
-341,7
+341,7
@@
public class SearchPage extends SoneTemplatePage {
if (!postReply.isPresent()) {
return null;
}
if (!postReply.isPresent()) {
return null;
}
- return postReply.get().getPost
().get
Id();
+ return postReply.get().getPostId();
}
/**
}
/**
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java
index
a2ee122
..
b617608
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java
@@
-97,7
+97,7
@@
public class GetReplyAjaxPage extends JsonPage {
private JsonObject createJsonReply(FreenetRequest request, PostReply reply, Sone currentSone) {
JsonObject jsonReply = new JsonObject();
jsonReply.put("id", reply.getId());
private JsonObject createJsonReply(FreenetRequest request, PostReply reply, Sone currentSone) {
JsonObject jsonReply = new JsonObject();
jsonReply.put("id", reply.getId());
- jsonReply.put("postId", reply.getPost
().get
Id());
+ jsonReply.put("postId", reply.getPostId());
jsonReply.put("soneId", reply.getSone().getId());
jsonReply.put("time", reply.getTime());
StringWriter stringWriter = new StringWriter();
jsonReply.put("soneId", reply.getSone().getId());
jsonReply.put("time", reply.getTime());
StringWriter stringWriter = new StringWriter();
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
index
8657a6a
..
9c4c76f
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java
@@
-134,7
+134,7
@@
public class GetStatusAjaxPage extends JsonPage {
JsonObject jsonReply = new JsonObject();
jsonReply.put("id", reply.getId());
jsonReply.put("sone", reply.getSone().getId());
JsonObject jsonReply = new JsonObject();
jsonReply.put("id", reply.getId());
jsonReply.put("sone", reply.getSone().getId());
- jsonReply.put("post", reply.getPost
().get
Id());
+ jsonReply.put("post", reply.getPostId());
jsonReply.put("postSone", reply.getPost().getSone().getId());
jsonReplies.add(jsonReply);
}
jsonReply.put("postSone", reply.getPost().getSone().getId());
jsonReplies.add(jsonReply);
}