Commit 36bdfb5c authored by Vanessa's avatar Vanessa

c

parent d732d9d4
...@@ -24,6 +24,7 @@ import java.util.logging.Logger; ...@@ -24,6 +24,7 @@ import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.b3log.latke.Keys; import org.b3log.latke.Keys;
import org.b3log.latke.Latkes;
import org.b3log.latke.event.Event; import org.b3log.latke.event.Event;
import org.b3log.latke.event.EventManager; import org.b3log.latke.event.EventManager;
import org.b3log.latke.mail.MailService; import org.b3log.latke.mail.MailService;
...@@ -299,8 +300,8 @@ public final class AddArticleCommentFromSymphonyAction { ...@@ -299,8 +300,8 @@ public final class AddArticleCommentFromSymphonyAction {
final String hashedEmail = MD5.hash(commentEmail.toLowerCase()); final String hashedEmail = MD5.hash(commentEmail.toLowerCase());
final int size = 60; final int size = 60;
final URL gravatarURL = final URL gravatarURL =
new URL("http://www.gravatar.com/avatar/" + hashedEmail + "?s=" new URL("http://secure.gravatar.com/avatar/" + hashedEmail + "?s="
+ size + "&r=G"); + size + "&d=" + Latkes.getServePath() + "/images/default-user-thumbnail.png");
try { try {
final HTTPRequest request = new HTTPRequest(); final HTTPRequest request = new HTTPRequest();
request.setURL(gravatarURL); request.setURL(gravatarURL);
...@@ -319,8 +320,8 @@ public final class AddArticleCommentFromSymphonyAction { ...@@ -319,8 +320,8 @@ public final class AddArticleCommentFromSymphonyAction {
} }
if (!defaultFileLengthMatched) { if (!defaultFileLengthMatched) {
thumbnailURL = "http://www.gravatar.com/avatar/" thumbnailURL = "http://secure.gravatar.com/avatar/" + hashedEmail + "?s="
+ hashedEmail + "?s=" + size + "&r=G"; + size + "&d=" + Latkes.getServePath() + "/images/default-user-thumbnail.png";
comment.put(Comment.COMMENT_THUMBNAIL_URL, thumbnailURL); comment.put(Comment.COMMENT_THUMBNAIL_URL, thumbnailURL);
LOGGER.log(Level.FINEST, "Comment thumbnail[URL={0}]", LOGGER.log(Level.FINEST, "Comment thumbnail[URL={0}]",
thumbnailURL); thumbnailURL);
......
...@@ -252,7 +252,7 @@ public final class InitService { ...@@ -252,7 +252,7 @@ public final class InitService {
+ "to delete them.")); + "to delete them."));
comment.put(Comment.COMMENT_ORIGINAL_COMMENT_ID, ""); comment.put(Comment.COMMENT_ORIGINAL_COMMENT_ID, "");
comment.put(Comment.COMMENT_ORIGINAL_COMMENT_NAME, ""); comment.put(Comment.COMMENT_ORIGINAL_COMMENT_NAME, "");
comment.put(Comment.COMMENT_THUMBNAIL_URL, "http://www.gravatar.com/avatar/59a5e8209c780307dbe9c9ba728073f5?s=60&r=G"); comment.put(Comment.COMMENT_THUMBNAIL_URL, "http://secure.gravatar.com/avatar/59a5e8209c780307dbe9c9ba728073f5??s=60&d=" + Latkes.getServePath() + "/images/default-user-thumbnail.png");
comment.put(Comment.COMMENT_DATE, date); comment.put(Comment.COMMENT_DATE, date);
comment.put(Comment.COMMENT_ON_ID, articleId); comment.put(Comment.COMMENT_ON_ID, articleId);
comment.put(Comment.COMMENT_ON_TYPE, Article.ARTICLE); comment.put(Comment.COMMENT_ON_TYPE, Article.ARTICLE);
......
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