From 02a0f9b2334d98d3d71bca73b8a90f5a36f6a5f3 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 17 Jan 2006 03:02:40 +0000 Subject: [PATCH] updates to MailingList code darcs-hash:20060117030240-5007d-78688488af5ff2118dfe06581f93fea5b7df5d9d.gz --- src/org/ibex/mail/MailingList.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/org/ibex/mail/MailingList.java b/src/org/ibex/mail/MailingList.java index 636fa4e..c0c3354 100644 --- a/src/org/ibex/mail/MailingList.java +++ b/src/org/ibex/mail/MailingList.java @@ -37,12 +37,13 @@ public class MailingList extends Persistent implements Target { public int bounceThreshhold = 10; public static class Subscriber { + public Subscriber(Address a) { this.address = a; } public Address address; - public Action posting; - public UserType type; - public SubscriptionType subscription; - public boolean send_copy_of_own_post; - public boolean filter_duplicates_when_ccd; + public Action posting = Action.Accept; + public UserType type = UserType.Member; + public SubscriptionType subscription = SubscriptionType.All; + public boolean send_copy_of_own_post = false; + public boolean filter_duplicates_when_ccd = true; } @@ -52,9 +53,9 @@ public class MailingList extends Persistent implements Target { public static MailingList getMailingList(String path) { return getMailingList(new File(path)); } public static MailingList getMailingList(File path) { if (!path.exists()) path.mkdirs(); - File f = new File(path.getAbsolutePath() + File.separatorChar + ".mailinglist"); + path = new File(path.getAbsolutePath() + File.separatorChar + ".mailinglist"); try { - if (f.exists()) return (MailingList)Persistent.read(f); + if (path.exists()) return (MailingList)Persistent.read(path); MailingList ret = new MailingList(path); ret.write(); return ret; @@ -66,7 +67,7 @@ public class MailingList extends Persistent implements Target { // Methods ////////////////////////////////////////////////////////////////////////////// - public Mailbox getArchive() { return FileBasedMailbox.getFileBasedMailbox(path, true); } + public Mailbox getArchive() { return FileBasedMailbox.getFileBasedMailbox(file.getParent(), true); } public void accept(Message m) throws IOException, MailException { StringBuffer buf = new StringBuffer(); -- 1.7.10.4