Update of /cvsroot/dithaka/james/src/org/dithaka/james
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21292/src/org/dithaka/james
Modified Files:
ForumMatcher.java
Log Message:
Lowering the forum names so that the comparison in the select is case insensitive. Added an error msg when the forum is not found in the db.
Index: ForumMatcher.java
===================================================================
RCS file: /cvsroot/dithaka/james/src/org/dithaka/james/ForumMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ForumMatcher.java 15 Jun 2005 13:51:13 -0000 1.2
--- ForumMatcher.java 23 Nov 2005 08:19:40 -0000 1.3
***************
*** 56,65 ****
public boolean matchRecipient(MailAddress address) throws MessagingException
{
! String sqlQuery = "FROM Forum WHERE fullMailAddress LIKE '" + address.getUser() + "@" + address.getHost() + "'";
try
{
! Forum forum = (Forum)PersistenceService.findOne(sqlQuery);
!
return forum != null;
}
--- 56,68 ----
public boolean matchRecipient(MailAddress address) throws MessagingException
{
! String sqlQuery = "FROM Forum WHERE lower(fullMailAddress) LIKE '" + address.getUser().toLowerCase() + "@" + address.getHost().toLowerCase() + "'";
try
{
! Forum forum = (Forum)PersistenceService.findOne(sqlQuery);
! if (forum == null){
! System.err.println("ForumMatcher.matchRecipient() -> Forum not found:"+address.getUser());
! }
!
return forum != null;
}
***************
*** 68,72 ****
ex.printStackTrace();
return false;
! }
}
}
--- 71,78 ----
ex.printStackTrace();
return false;
! } catch (NullPointerException e) {
! System.err.println("No forum was found with this name: "+address.getUser());
! return false;
! }
}
}
|