Commit e2d50bab authored by Liang Ding's avatar Liang Ding

Merge remote-tracking branch 'refs/remotes/origin/master' into 1.4.0-dev

parents 8a5ff18a 409c5ad5
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
> 加入[**黑客派**](https://hacpai.com/register),与其他程序员、设计师共同成长! > 加入[**黑客派**](https://hacpai.com/register),与其他程序员、设计师共同成长!
## Authors
[Daniel](https://github.com/88250) and [Vanessa](https://github.com/Vanessa219) are the main authors of Solo, [here](https://github.com/b3log/solo/graphs/contributors) are all contributors.
Solo 的主要作者是 [Daniel](https://github.com/88250)[Vanessa](https://github.com/Vanessa219),所有贡献者可以在[这里](https://github.com/b3log/solo/graphs/contributors)看到。
## Features ## Features
* Tags * Tags
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Description: Solo POM. Description: Solo POM.
Version: 3.9.1.18, Feb 20, 2016 Version: 3.9.1.19, May 3, 2016
Author: Liang Ding Author: <a href="http://88250.b3log.org">Liang Ding</a>
Author: <a href="http://www.annpeter.cn">Ann Peter</a>
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
<servlet.version>3.1.0</servlet.version> <servlet.version>3.1.0</servlet.version>
<slf4j.version>1.7.5</slf4j.version> <slf4j.version>1.7.5</slf4j.version>
<jsoup.version>1.5.2</jsoup.version> <jsoup.version>1.9.1</jsoup.version>
<markdownpapers-core.version>1.4.2</markdownpapers-core.version> <markdownpapers-core.version>1.4.2</markdownpapers-core.version>
<qiniu.version>7.0.4.1</qiniu.version> <qiniu.version>7.0.4.1</qiniu.version>
<jetty.version>9.2.13.v20150730</jetty.version> <jetty.version>9.2.13.v20150730</jetty.version>
......
...@@ -41,7 +41,8 @@ import org.json.JSONObject; ...@@ -41,7 +41,8 @@ import org.json.JSONObject;
* This listener is responsible for processing article comment reply. * This listener is responsible for processing article comment reply.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.7, Nov 20, 2015 * @author <a href="http://www.wanglay.com">Lei Wang</a>
* @version 1.2.1.7, May 6, 2016
* @since 0.3.1 * @since 0.3.1
*/ */
public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSONObject> { public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSONObject> {
...@@ -62,7 +63,8 @@ public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSO ...@@ -62,7 +63,8 @@ public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSO
final JSONObject comment = eventData.optJSONObject(Comment.COMMENT); final JSONObject comment = eventData.optJSONObject(Comment.COMMENT);
final JSONObject article = eventData.optJSONObject(Article.ARTICLE); final JSONObject article = eventData.optJSONObject(Article.ARTICLE);
LOGGER.log(Level.DEBUG, "Processing an event[type={0}, data={1}] in listener[className={2}]", LOGGER.log(Level.DEBUG,
"Processing an event[type={0}, data={1}] in listener[className={2}]",
new Object[]{event.getType(), eventData, ArticleCommentReplyNotifier.class.getName()}); new Object[]{event.getType(), eventData, ArticleCommentReplyNotifier.class.getName()});
final String originalCommentId = comment.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID); final String originalCommentId = comment.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID);
...@@ -108,9 +110,7 @@ public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSO ...@@ -108,9 +110,7 @@ public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSO
message.setFrom(adminEmail); message.setFrom(adminEmail);
message.addRecipient(originalCommentEmail); message.addRecipient(originalCommentEmail);
final JSONObject replyNotificationTemplate = preferenceQueryService.getReplyNotificationTemplate(); final JSONObject replyNotificationTemplate = preferenceQueryService.getReplyNotificationTemplate();
final String mailSubject = replyNotificationTemplate.getString("subject").replace("${blogTitle}", blogTitle);
message.setSubject(mailSubject);
final String articleTitle = article.getString(Article.ARTICLE_TITLE); final String articleTitle = article.getString(Article.ARTICLE_TITLE);
final String articleLink = Latkes.getServePath() + article.getString(Article.ARTICLE_PERMALINK); final String articleLink = Latkes.getServePath() + article.getString(Article.ARTICLE_PERMALINK);
final String commentName = comment.getString(Comment.COMMENT_NAME); final String commentName = comment.getString(Comment.COMMENT_NAME);
...@@ -122,9 +122,25 @@ public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSO ...@@ -122,9 +122,25 @@ public final class ArticleCommentReplyNotifier extends AbstractEventListener<JSO
} else { } else {
commenter = commentName; commenter = commentName;
} }
final String mailSubject = replyNotificationTemplate.getString(
"subject").replace("${postLink}", articleLink)
.replace("${postTitle}", articleTitle)
.replace("${replier}", commenter)
.replace("${blogTitle}", blogTitle)
.replace("${replyURL}",
Latkes.getServePath() + commentSharpURL)
.replace("${replyContent}", commentContent);
final String mailBody = replyNotificationTemplate.getString("body").replace("${postLink}", articleLink).replace("${postTitle}", articleTitle).replace("${replier}", commenter).replace("${replyURL}", Latkes.getServePath() + commentSharpURL).replace( message.setSubject(mailSubject);
"${replyContent}", commentContent); final String mailBody = replyNotificationTemplate
.getString("body")
.replace("${postLink}", articleLink)
.replace("${postTitle}", articleTitle)
.replace("${replier}", commenter)
.replace("${blogTitle}", blogTitle)
.replace("${replyURL}",
Latkes.getServePath() + commentSharpURL)
.replace("${replyContent}", commentContent);
message.setHtmlBody(mailBody); message.setHtmlBody(mailBody);
LOGGER.log(Level.DEBUG, "Sending a mail[mailSubject={0}, mailBody=[{1}] to [{2}]", LOGGER.log(Level.DEBUG, "Sending a mail[mailSubject={0}, mailBody=[{1}] to [{2}]",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.b3log.solo.plugin.list; package org.b3log.solo.plugin.list;
import org.apache.commons.lang.StringUtils;
import org.b3log.latke.Latkes; import org.b3log.latke.Latkes;
import org.b3log.latke.event.AbstractEventListener; import org.b3log.latke.event.AbstractEventListener;
import org.b3log.latke.event.Event; import org.b3log.latke.event.Event;
...@@ -27,6 +28,7 @@ import org.json.JSONObject; ...@@ -27,6 +28,7 @@ import org.json.JSONObject;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
import org.jsoup.parser.Parser;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
...@@ -34,7 +36,8 @@ import org.jsoup.select.Elements; ...@@ -34,7 +36,8 @@ import org.jsoup.select.Elements;
* List (table of contents of an article) handler. * List (table of contents of an article) handler.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, May 30, 2014 * @author <a href="http://www.annpeter.cn">Ann Peter</a>
* @version 1.0.1.0, May 4, 2016
* @since 0.6.7 * @since 0.6.7
*/ */
public class ListHandler extends AbstractEventListener<JSONObject> { public class ListHandler extends AbstractEventListener<JSONObject> {
...@@ -56,7 +59,8 @@ public class ListHandler extends AbstractEventListener<JSONObject> { ...@@ -56,7 +59,8 @@ public class ListHandler extends AbstractEventListener<JSONObject> {
String content = article.optString(Article.ARTICLE_CONTENT); String content = article.optString(Article.ARTICLE_CONTENT);
final Document doc = Jsoup.parse(content); final Document doc = Jsoup.parse(content, StringUtils.EMPTY, Parser.htmlParser());
doc.outputSettings().prettyPrint(false);
final StringBuilder listBuilder = new StringBuilder(); final StringBuilder listBuilder = new StringBuilder();
......
...@@ -16,17 +16,20 @@ ...@@ -16,17 +16,20 @@
# #
# Description: Solo logging configurations. # Description: Solo logging configurations.
# Version: 1.1.0.4, Nov 5, 2015 # Version: 1.1.0.4, May 6, 2016
# Author: Liang Ding # Author: <a href="http://88250.b3log.org">Liang Ding</a>
# Author: <a href="http://www.wanglay.com">Lei Wang</a>
# #
log4j.rootLogger=INFO, stdout log4j.rootLogger=INFO,stdout,file
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%-5p]-[%d{yyyy-MM-dd HH:mm:ss}]-[%c:%L]: %m%n log4j.appender.stdout.layout.ConversionPattern=[%-5p]-[%d{yyyy-MM-dd HH:mm:ss}]-[%c:%L]: %m%n
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=FATAL
log4j.logger.org.b3log.solo=INFO log4j.logger.org.b3log.solo=INFO
log4j.logger.org.b3log.latke=ERROR log4j.logger.org.b3log.latke=ERROR
...@@ -35,3 +38,11 @@ log4j.logger.org.b3log.latke.util.freemarker.Templates=ERROR ...@@ -35,3 +38,11 @@ log4j.logger.org.b3log.latke.util.freemarker.Templates=ERROR
log4j.logger.org.eclipse.jetty=WARN log4j.logger.org.eclipse.jetty=WARN
log4j.logger.freemarker=WARN log4j.logger.freemarker=WARN
log4j.logger.com.mchange=WARN log4j.logger.com.mchange=WARN
# File Logger Conf
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=./solo.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[%-5p]-[%d{yyyy-MM-dd HH:mm:ss}]-[%c:%L]: %m%n
\ No newline at end of file
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