You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2013/04/06 15:50:06 UTC

svn commit: r1465243 - /roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/util/MailUtil.java

Author: snoopdave
Date: Sat Apr  6 13:50:06 2013
New Revision: 1465243

URL: http://svn.apache.org/r1465243
Log:
reverting to spaces, not tabs. for real this time, I hope

Modified:
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/util/MailUtil.java

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/util/MailUtil.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/util/MailUtil.java?rev=1465243&r1=1465242&r2=1465243&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/util/MailUtil.java (original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/util/MailUtil.java Sat Apr  6 13:50:06 2013
@@ -294,35 +294,35 @@ public class MailUtil {
         // build list of email addresses to send notification to
         Set subscribers = new TreeSet();
         
-		// If we are to notify subscribers, then...
-		if (notifySubscribers) {
-			log.debug("Sending notification email to all subscribers");
+        // If we are to notify subscribers, then...
+        if (notifySubscribers) {
+            log.debug("Sending notification email to all subscribers");
 
-			// Get all the subscribers to this comment thread
-			List comments = entry.getComments(true, true);
-			for (Iterator it = comments.iterator(); it.hasNext();) {
-				WeblogEntryComment comment = (WeblogEntryComment) it.next();
-				if (!StringUtils.isEmpty(comment.getEmail())) {
-					// If user has commented twice,
-					// count the most recent notify setting
-					if (commentObject.getApproved()) {
-						if (comment.getNotify().booleanValue()) {
-							// only add those with valid email
-							if (comment.getEmail().matches(EMAIL_ADDR_REGEXP)) {
-								log.info("Add to subscribers list : " + comment.getEmail());
-								subscribers.add(comment.getEmail());
-							}
-						} else {
-							// remove user who doesn't want to be notified
-							log.info("Remove from subscribers list : " + comment.getEmail());
-							subscribers.remove(comment.getEmail());
-						}
-					}
-				}
-			}
-		} else {
-			log.debug("Sending notification email only to weblog owner");
-		}
+            // Get all the subscribers to this comment thread
+            List comments = entry.getComments(true, true);
+            for (Iterator it = comments.iterator(); it.hasNext();) {
+                WeblogEntryComment comment = (WeblogEntryComment) it.next();
+                if (!StringUtils.isEmpty(comment.getEmail())) {
+                    // If user has commented twice,
+                    // count the most recent notify setting
+                    if (commentObject.getApproved()) {
+                        if (comment.getNotify().booleanValue()) {
+                            // only add those with valid email
+                            if (comment.getEmail().matches(EMAIL_ADDR_REGEXP)) {
+                                log.info("Add to subscribers list : " + comment.getEmail());
+                                subscribers.add(comment.getEmail());
+                            }
+                        } else {
+                            // remove user who doesn't want to be notified
+                            log.info("Remove from subscribers list : " + comment.getEmail());
+                            subscribers.remove(comment.getEmail());
+                        }
+                    }
+                }
+            }
+        } else {
+            log.debug("Sending notification email only to weblog owner");
+        }
         
         // Form array of commenter addrs
         String[] commenterAddrs = (String[])subscribers.toArray(new String[0]);
@@ -362,7 +362,7 @@ public class MailUtil {
         
         // Build link back to comment
         String commentURL = WebloggerFactory.getWeblogger()
-			.getUrlStrategy().getWeblogCommentsURL(weblog, null, entry.getAnchor(), true);
+            .getUrlStrategy().getWeblogCommentsURL(weblog, null, entry.getAnchor(), true);
         
         if (escapeHtml) {
             msg.append(commentURL);
@@ -383,7 +383,7 @@ public class MailUtil {
             RollerMessage rollerMessage = (RollerMessage)it.next();
             ownermsg.append((escapeHtml) ? "" : "<li>");
             ownermsg.append(MessageFormat.format(resources.getString(
-				rollerMessage.getKey()), (Object[])rollerMessage.getArgs()) );
+                rollerMessage.getKey()), (Object[])rollerMessage.getArgs()) );
             ownermsg.append((escapeHtml) ? "\n\n" : "</li>");
         }
         if (messages.getMessageCount() > 0) {
@@ -401,7 +401,7 @@ public class MailUtil {
             RollerMessage rollerMessage = (RollerMessage)it.next();
             ownermsg.append((escapeHtml) ? "" : "<li>");
             ownermsg.append(MessageFormat.format(resources.getString(
-				rollerMessage.getKey()), (Object[])rollerMessage.getArgs()) );
+                rollerMessage.getKey()), (Object[])rollerMessage.getArgs()) );
             ownermsg.append((escapeHtml) ? "\n\n" : "</li>");
         }
         if (messages.getErrorCount() > 0) {
@@ -550,7 +550,7 @@ public class MailUtil {
         msg.append(resources.getString("email.comment.commentApproved"));
         msg.append("\n\n");
         msg.append(WebloggerFactory.getWeblogger().getUrlStrategy()
-			.getWeblogCommentsURL(weblog, null, entry.getAnchor(), true));
+            .getWeblogCommentsURL(weblog, null, entry.getAnchor(), true));
         
         // send message to author of approved comment
         try {
@@ -672,7 +672,7 @@ public class MailUtil {
                     remainingAddresses=ex.getValidUnsentAddresses();
                 }
             } while (remainingAddresses!=null && remainingAddresses.length>0 
-					&& remainingAddresses.length!=nAddresses);
+                    && remainingAddresses.length!=nAddresses);
             
         } finally {
             transport.close();