From 27ae9095639bb228a1b7ff86a3ebe4264abf05be Mon Sep 17 00:00:00 2001
From: mschaefers <mschaefers@scoop-gmbh.de>
Date: Thu, 29 Nov 2012 12:33:09 -0500
Subject: [PATCH] feature: when using LdapUserService one can configure Gitblit to fetch all users from ldap that can possibly login. This allows to see newly generated LDAP users instantly in Gitblit. By now an LDAP user had to log in once to appear in GitBlit.

---
 src/com/gitblit/models/FeedModel.java |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/src/com/gitblit/models/FeedModel.java b/src/com/gitblit/models/FeedModel.java
index bed0a9c..08f9e48 100644
--- a/src/com/gitblit/models/FeedModel.java
+++ b/src/com/gitblit/models/FeedModel.java
@@ -16,9 +16,6 @@
 package com.gitblit.models;
 
 import java.io.Serializable;
-import java.text.MessageFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 
 import com.gitblit.utils.StringUtils;
@@ -32,8 +29,8 @@
 
 	public String repository;
 	public String branch;
-	public int maxRetrieval;
-	public Date lastRefresh;
+	public Date lastRefreshDate;
+	public Date currentRefreshDate;
 
 	public boolean subscribed;
 
@@ -41,29 +38,27 @@
 
 	public FeedModel() {
 		this("");
+		subscribed = false;
 	}
 
 	public FeedModel(String definition) {
-		maxRetrieval = -1;
-		lastRefresh = new Date(0);
+		subscribed = true;
+		lastRefreshDate = new Date(0);
+		currentRefreshDate = new Date(0);
 
 		String[] fields = definition.split(":");
 		repository = fields[0];
 		if (fields.length > 1) {
 			branch = fields[1];
-			maxRetrieval = Integer.parseInt(fields[2]);
-			try {
-				lastRefresh = new SimpleDateFormat("yyyyMMddHHmmss").parse(fields[3]);
-			} catch (ParseException e) {
-			}
-			subscribed = true;
 		}
 	}
 
 	@Override
 	public String toString() {
-		return MessageFormat.format("{0}:{1}:{2,number,0}:{3,date,yyyyMMddHHmmss}", repository,
-				branch, maxRetrieval, lastRefresh);
+		if (StringUtils.isEmpty(branch)) {
+			return repository;
+		}
+		return repository + ":" + branch;
 	}
 
 	@Override
@@ -83,7 +78,7 @@
 
 	@Override
 	public int hashCode() {
-		return (repository + (StringUtils.isEmpty(branch) ? "" : branch)).toLowerCase().hashCode();
+		return toString().toLowerCase().hashCode();
 	}
 
 	@Override

--
Gitblit v1.9.1