Author: batosai
Date: 2008-08-10 15:37:41 +0000 (Sun, 10 Aug 2008)
New Revision: 21719
Modified:
trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
Log:
No idea why this doesn't work. Will have a look at it later.
Anyway, the process of finding an identity by its URI needs a serious refactor.
Modified: trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoTplugin.java 2008-08-10 15:29:22 UTC
(rev 21718)
+++ trunk/apps/WoT/src/plugins/WoT/WoTplugin.java 2008-08-10 15:37:41 UTC
(rev 21719)
@@ -263,12 +263,18 @@
try {
FreenetURI uri = new
FreenetURI(request.getPartAsString("identityURI", 1024));
- if(wot.getIdentityByURI(uri) != null) return "We
already know that identity !";
- Identity identity = new Identity(uri, new Date(0));
- db.store(identity);
- db.commit();
- fetcher.fetch(identity);
+ // FIXME For some reason, the result is always null. So
we re-create existing identities :(
+ Identity identity = wot.getIdentityByURI(uri);
+
+ if(identity == null) {
+ identity = new Identity(uri, new Date(0));
+ db.store(identity);
+ db.commit();
+ fetcher.fetch(identity);
+ }
+ else return "We already know that identity !";
+
} catch (Exception e) {
return e.getLocalizedMessage();
}