Commit 2033033f authored by Liang Ding's avatar Liang Ding

评论同步至社区

parent dfefaffd
...@@ -246,6 +246,7 @@ public final class CommentMgmtService { ...@@ -246,6 +246,7 @@ public final class CommentMgmtService {
final String commentEmail = requestJSONObject.getString(Comment.COMMENT_EMAIL).trim().toLowerCase(); final String commentEmail = requestJSONObject.getString(Comment.COMMENT_EMAIL).trim().toLowerCase();
final String commentURL = requestJSONObject.optString(Comment.COMMENT_URL); final String commentURL = requestJSONObject.optString(Comment.COMMENT_URL);
String commentContent = requestJSONObject.getString(Comment.COMMENT_CONTENT).replaceAll("\\n", SoloServletListener.ENTER_ESC); String commentContent = requestJSONObject.getString(Comment.COMMENT_CONTENT).replaceAll("\\n", SoloServletListener.ENTER_ESC);
final String contentNoEsc = commentContent;
commentContent = StringEscapeUtils.escapeHtml(commentContent); commentContent = StringEscapeUtils.escapeHtml(commentContent);
final String originalCommentId = requestJSONObject.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID); final String originalCommentId = requestJSONObject.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID);
// Step 1: Add comment // Step 1: Add comment
...@@ -305,6 +306,7 @@ public final class CommentMgmtService { ...@@ -305,6 +306,7 @@ public final class CommentMgmtService {
// Step 5: Fire add comment event // Step 5: Fire add comment event
final JSONObject eventData = new JSONObject(); final JSONObject eventData = new JSONObject();
eventData.put(Comment.COMMENT, comment); eventData.put(Comment.COMMENT, comment);
comment.put(Comment.COMMENT_CONTENT, contentNoEsc);
eventData.put(Article.ARTICLE, article); eventData.put(Article.ARTICLE, article);
eventManager.fireEventSynchronously(new Event<JSONObject>(EventTypes.ADD_COMMENT_TO_ARTICLE, eventData)); eventManager.fireEventSynchronously(new Event<JSONObject>(EventTypes.ADD_COMMENT_TO_ARTICLE, eventData));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment