/*
 * MailMessage.java - This class holds an abstract base class for implementing a mailinglist-specific
 *                    message with required identifiers and content.
 * 
 * Copyright (C) 2010 Magnus Hagander <magnus@hagander.net>
 * 
 * This software is released under the BSD license.
 */
package net.hagander.mailinglistmoderator.backend;

/**
 * 
 * @author Magnus Hagander <magnus@hagander.net>
 * 
 *         This base class is simply a container for some common properties.
 */
public abstract class MailMessage {
	private String sender;
	private String subject;
	private String content;
	private statuslevel status = statuslevel.Defer;

	public enum statuslevel {
		Accept, Reject, Defer
	};

	public MailMessage(String sender, String subject, String content) {
		this.sender = sender;
		this.subject = subject;
		this.content = content;
	}

	public String getSender() {
		return sender;
	}

	public String getSubject() {
		return subject;
	}

	public String getContent() {
		return content;
	}

	public void setStatus(statuslevel status) {
		this.status = status;
	}

	public statuslevel getStatus() {
		return status;
	}
}

@@ -766,24 +766,305 @@
  content) %7B%0A
+%09%09/* %0A%09%09 * Create new strings to de-couple from large strings being returned%0A%09%09 * in regex matches. We do this here to get it in a centralized location,%0A%09%09 * even if it means we might duplicate once or twice too many.%0A%09%09 * Also, limit the length of the content to 255 bytes.%0A%09%09 */%0A
 %09%09this.sende
@@ -1067,22 +1067,34 @@
 ender = 
+new String(
 sender
+)
 ;%0A%09%09this
@@ -1108,41 +1108,159 @@
 t = 
+new String(
 subject
+)
 ;%0A%09%09
-this.content = content
+if (content.length() %3E 255)%0A%09%09%09this.content = new String(content.substring(0,255));%0A%09%09else%0A%09%09%09this.content = new String(content)
 ;%0A%09%7D

Create new instances of strings, and truncate length of message contents