# HG changeset patch
# User cli
# Date 1250780258 -7200
# Node ID efce4ec25564c9602c2c333d58f9ebef71ce99c2
# Parent  de98fd5b35f5ab8f59a48fe2137631b2eed65c71
Fix #548: API change; changed parameter type of Storage.getGroupsForList()

diff -r de98fd5b35f5 -r efce4ec25564 org/sonews/mlgw/Dispatcher.java
--- a/org/sonews/mlgw/Dispatcher.java	Thu Aug 20 16:49:38 2009 +0200
+++ b/org/sonews/mlgw/Dispatcher.java	Thu Aug 20 16:57:38 2009 +0200
@@ -111,7 +111,7 @@
       // listPost[0] is of form "<mailto:dev@openoffice.org>"
       listPost[0]  = chunkListPost(listPost[0]);
       listPostAddr = new InternetAddress(listPost[0], false);
-      groups = StorageManager.current().getGroupsForList(listPostAddr);
+      groups = StorageManager.current().getGroupsForList(listPostAddr.getAddress());
     }
     else if(fallback)
     {
@@ -123,7 +123,8 @@
       {
         if(toa instanceof InternetAddress)
         {
-          List<String> g = StorageManager.current().getGroupsForList((InternetAddress) toa);
+          List<String> g = StorageManager.current()
+            .getGroupsForList(((InternetAddress)toa).getAddress());
           groups.addAll(g);
         }
       }
diff -r de98fd5b35f5 -r efce4ec25564 org/sonews/storage/Storage.java
--- a/org/sonews/storage/Storage.java	Thu Aug 20 16:49:38 2009 +0200
+++ b/org/sonews/storage/Storage.java	Thu Aug 20 16:57:38 2009 +0200
@@ -19,7 +19,6 @@
 package org.sonews.storage;
 
 import java.util.List;
-import javax.mail.internet.InternetAddress;
 import org.sonews.feed.Subscription;
 import org.sonews.util.Pair;
 
@@ -92,7 +91,14 @@
   List<Channel> getGroups()
     throws StorageBackendException;
 
-  List<String> getGroupsForList(InternetAddress inetaddress)
+  /**
+   * Retrieves the collection of groupnames that are associated with the
+   * given list address.
+   * @param inetaddress
+   * @return
+   * @throws StorageBackendException
+   */
+  List<String> getGroupsForList(String listAddress)
     throws StorageBackendException;
 
   int getLastArticleNumber(Group group)
diff -r de98fd5b35f5 -r efce4ec25564 org/sonews/storage/impl/JDBCDatabase.java
--- a/org/sonews/storage/impl/JDBCDatabase.java	Thu Aug 20 16:49:38 2009 +0200
+++ b/org/sonews/storage/impl/JDBCDatabase.java	Thu Aug 20 16:57:38 2009 +0200
@@ -31,7 +31,6 @@
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 import javax.mail.Header;
-import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeUtility;
 import org.sonews.config.Config;
 import org.sonews.util.Log;
@@ -1053,14 +1052,14 @@
   }
 
   @Override
-  public List<String> getGroupsForList(InternetAddress listAddress)
+  public List<String> getGroupsForList(String listAddress)
     throws StorageBackendException
   {
     ResultSet rs = null;
     
     try
     {
-      this.pstmtGetGroupForList.setString(1, listAddress.getAddress());
+      this.pstmtGetGroupForList.setString(1, listAddress);
 
       rs = this.pstmtGetGroupForList.executeQuery();
       List<String> groups = new ArrayList<String>();