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/utils/SyndicationUtils.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/com/gitblit/utils/SyndicationUtils.java b/src/com/gitblit/utils/SyndicationUtils.java
index 6ba8d73..d01d469 100644
--- a/src/com/gitblit/utils/SyndicationUtils.java
+++ b/src/com/gitblit/utils/SyndicationUtils.java
@@ -56,14 +56,13 @@
 	 * @param feedLink
 	 * @param title
 	 * @param description
-	 * @param repository
 	 * @param entryModels
 	 * @param os
 	 * @throws IOException
 	 * @throws FeedException
 	 */
 	public static void toRSS(String hostUrl, String feedLink, String title, String description,
-			String repository, List<FeedEntryModel> entryModels, OutputStream os)
+			List<FeedEntryModel> entryModels, OutputStream os)
 			throws IOException, FeedException {
 
 		SyndFeed feed = new SyndFeedImpl();
@@ -97,8 +96,14 @@
 			}
 
 			SyndContent content = new SyndContentImpl();
-			content.setType(entryModel.contentType);
-			content.setValue(entryModel.content);
+			if (StringUtils.isEmpty(entryModel.contentType)
+					|| entryModel.contentType.equalsIgnoreCase("text/plain")) {
+				content.setType("text/html");
+				content.setValue(StringUtils.breakLinesForHtml(entryModel.content));
+			} else {
+				content.setType(entryModel.contentType);
+				content.setValue(entryModel.content);
+			}
 			entry.setDescription(content);
 
 			entries.add(entry);
@@ -167,9 +172,9 @@
 	 * @return a list of SyndicationModel entries
 	 * @throws {@link IOException}
 	 */
-	public static List<FeedEntryModel> readSearchFeed(String url, String repository,
-			String branch, String fragment, Constants.SearchType searchType, int numberOfEntries,
-			int page, String username, char[] password) throws IOException {
+	public static List<FeedEntryModel> readSearchFeed(String url, String repository, String branch,
+			String fragment, Constants.SearchType searchType, int numberOfEntries, int page,
+			String username, char[] password) throws IOException {
 		// determine parameters
 		List<String> parameters = new ArrayList<String>();
 		parameters.add("s=" + StringUtils.encodeURL(fragment));

--
Gitblit v1.9.1