On Friday 14 November 2008 00:36, xor at freenetproject.org wrote:
> Author: xor
> Date: 2008-11-14 00:36:56 +0000 (Fri, 14 Nov 2008)
> New Revision: 23550
>
> Modified:
> trunk/plugins/WoT/introduction/IntroductionServer.java
> Log:
> Reflect interface changes.
>
> Modified: trunk/plugins/WoT/introduction/IntroductionServer.java
> ===================================================================
> --- trunk/plugins/WoT/introduction/IntroductionServer.java 2008-11-14
00:36:15 UTC (rev 23549)
> +++ trunk/plugins/WoT/introduction/IntroductionServer.java 2008-11-14
00:36:56 UTC (rev 23550)
> @@ -16,6 +16,7 @@
> import plugins.WoT.Identity;
> import plugins.WoT.IdentityFetcher;
> import plugins.WoT.OwnIdentity;
> +import plugins.WoT.introduction.captcha.CaptchaFactory1;
>
> import com.db4o.ObjectContainer;
> import com.db4o.ObjectSet;
> @@ -203,7 +204,7 @@
> OutputStream os = tempB.getOutputStream();
>
> try {
> - IntroductionPuzzle p =
> mPuzzleFactories[(int)(Math.random() * 100) %
mPuzzleFactories.length].generatePuzzle();
> + IntroductionPuzzle p =
> mPuzzleFactories[(int)(Math.random() * 100) %
mPuzzleFactories.length].generatePuzzle(db, identity);
You should really get rid of this ugliness (random()*100 % something) ...
> p.exportToXML(os);
> os.close(); os = null;
> tempB.setReadOnly();
> @@ -250,7 +251,8 @@
> OwnIdentity puzzleOwner = (OwnIdentity)p.getInserter();
> Identity newIdentity =
> Identity.importIntroductionFromXML(db,
mIdentityFetcher, result.asBucket().getInputStream());
> puzzleOwner.setTrust(db, newIdentity, (byte)0, null);
> /* FIXME: is 0 the
proper trust for newly imported identities? */
> - db.delete(p);
> + p.setSolved();
> + db.store(p);
> db.commit();
>
> state.cancel(); /* FIXME: is this necessary */
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20081115/30d3fdb5/attachment.pgp>