Author: xor
Date: 2008-11-14 00:36:15 +0000 (Fri, 14 Nov 2008)
New Revision: 23549

Modified:
   trunk/plugins/WoT/introduction/IntroductionPuzzleFactory.java
   trunk/plugins/WoT/introduction/captcha/CaptchaFactory1.java
Log:
Reflect necessary changes.

Modified: trunk/plugins/WoT/introduction/IntroductionPuzzleFactory.java
===================================================================
--- trunk/plugins/WoT/introduction/IntroductionPuzzleFactory.java       
2008-11-14 00:35:15 UTC (rev 23548)
+++ trunk/plugins/WoT/introduction/IntroductionPuzzleFactory.java       
2008-11-14 00:36:15 UTC (rev 23549)
@@ -7,7 +7,10 @@
 
 import java.io.IOException;
 
+import com.db4o.ObjectContainer;
+
 import plugins.WoT.Identity;
+import plugins.WoT.OwnIdentity;
 
 /**
  * @author xor
@@ -15,6 +18,6 @@
  */
 public interface IntroductionPuzzleFactory {
        
-       public IntroductionPuzzle generatePuzzle(Identity inserter, int index) 
throws IOException;
+       public IntroductionPuzzle generatePuzzle(ObjectContainer db, 
OwnIdentity inserter) throws IOException;
 
 }

Modified: trunk/plugins/WoT/introduction/captcha/CaptchaFactory1.java
===================================================================
--- trunk/plugins/WoT/introduction/captcha/CaptchaFactory1.java 2008-11-14 
00:35:15 UTC (rev 23548)
+++ trunk/plugins/WoT/introduction/captcha/CaptchaFactory1.java 2008-11-14 
00:36:15 UTC (rev 23549)
@@ -8,10 +8,13 @@
 import java.awt.image.BufferedImage;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.util.Date;
 
 import javax.imageio.ImageIO;
 
-import plugins.WoT.Identity;
+import com.db4o.ObjectContainer;
+
+import plugins.WoT.OwnIdentity;
 import plugins.WoT.introduction.IntroductionPuzzle;
 import plugins.WoT.introduction.IntroductionPuzzleFactory;
 import plugins.WoT.introduction.captcha.kaptcha.impl.DefaultKaptcha;
@@ -29,7 +32,7 @@
  */
 public class CaptchaFactory1 implements IntroductionPuzzleFactory {
 
-       public IntroductionPuzzle generatePuzzle(Identity inserter, int index) 
throws IOException {
+       public IntroductionPuzzle generatePuzzle(ObjectContainer db, 
OwnIdentity inserter) throws IOException {
                ByteArrayOutputStream out = new ByteArrayOutputStream(10 * 
1024);
                try {
                        DefaultKaptcha captcha = new DefaultKaptcha();
@@ -38,7 +41,9 @@
                         /* TODO: find out the maximum size of the captchas and 
put it here */
                        
                        ImageIO.write(img, "jpg", out);
-                       return new IntroductionPuzzle(inserter, "image/jpeg", 
out.toByteArray(), text, index);
+                       
+                       Date dateOfInsertion = new Date();
+                       return new IntroductionPuzzle(inserter, "image/jpeg", 
out.toByteArray(), text, dateOfInsertion, IntroductionPuzzle.getFreeIndex(db, 
inserter, dateOfInsertion));
                }
                finally {
                        out.close();

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to