From ffe73776d1fa1eb138c23ff780bcecbaca56a9fc Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 10 Jun 2013 08:36:53 -0400
Subject: [PATCH] Documentation
---
src/main/java/com/gitblit/utils/ActivityUtils.java | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/gitblit/utils/ActivityUtils.java b/src/main/java/com/gitblit/utils/ActivityUtils.java
index 732fdeb..015e8d3 100644
--- a/src/main/java/com/gitblit/utils/ActivityUtils.java
+++ b/src/main/java/com/gitblit/utils/ActivityUtils.java
@@ -81,7 +81,7 @@
Map<String, Activity> activity = new HashMap<String, Activity>();
for (RepositoryModel model : models) {
- if (model.maxActivityCommits == -1) {
+ if (!model.isShowActivity()) {
// skip this repository
continue;
}
@@ -165,7 +165,7 @@
* size of thumbnail. if width <= 0, the default of 50 is used.
* @return
*/
- public static String getGravatarThumbnailUrl(String email, int width) {
+ public static String getGravatarIdenticonUrl(String email, int width) {
if (width <= 0) {
width = 50;
}
@@ -174,6 +174,25 @@
"https://www.gravatar.com/avatar/{0}?s={1,number,0}&d=identicon", emailHash, width);
return url;
}
+
+ /**
+ * Creates a Gravatar thumbnail url from the specified email address.
+ *
+ * @param email
+ * address to query Gravatar
+ * @param width
+ * size of thumbnail. if width <= 0, the default of 50 is used.
+ * @return
+ */
+ public static String getGravatarThumbnailUrl(String email, int width) {
+ if (width <= 0) {
+ width = 50;
+ }
+ String emailHash = StringUtils.getMD5(email);
+ String url = MessageFormat.format(
+ "https://www.gravatar.com/avatar/{0}?s={1,number,0}&d=mm", emailHash, width);
+ return url;
+ }
/**
* Returns the Gravatar profile, if available, for the specified hashcode.
--
Gitblit v1.9.1