Author: xor
Date: 2008-11-10 02:30:11 +0000 (Mon, 10 Nov 2008)
New Revision: 23461
Modified:
trunk/plugins/WoT/Identity.java
trunk/plugins/WoT/IdentityParser.java
trunk/plugins/WoT/WoT.java
Log:
Nickname of not fetched identities should be null. If the nickname has once
been set to a not empty string, changing is not allowed anymore.
Modified: trunk/plugins/WoT/Identity.java
===================================================================
--- trunk/plugins/WoT/Identity.java 2008-11-10 02:23:33 UTC (rev 23460)
+++ trunk/plugins/WoT/Identity.java 2008-11-10 02:30:11 UTC (rev 23461)
@@ -557,7 +557,7 @@
* @throws InvalidParameterException if the nickName's length is bigger
than 50, or if it empty
*/
public synchronized void setNickName(String newNickname) throws
InvalidParameterException {
- String nick = newNickname.trim();
+ String nick = newNickname == null ? "" : newNickname.trim();
if(nick.length() == 0) throw new
InvalidParameterException("Blank nickName");
if(nick.length() > 50) throw new
InvalidParameterException("Nickname is too long (50 chars max)");
Modified: trunk/plugins/WoT/IdentityParser.java
===================================================================
--- trunk/plugins/WoT/IdentityParser.java 2008-11-10 02:23:33 UTC (rev
23460)
+++ trunk/plugins/WoT/IdentityParser.java 2008-11-10 02:30:11 UTC (rev
23461)
@@ -134,7 +134,7 @@
// Create trustee only if the
truster has a positive score.
// This is to avoid Identity
spam when announcements will be here.
if(identity.getBestScore(db) >
0) {
- trustee = new
Identity(new FreenetURI(attrs.getValue("uri")), "Not found yet...", false);
+ trustee = new
Identity(new FreenetURI(attrs.getValue("uri")), null, false);
db.store(trustee);
db.commit(); /* TODO:
this commit() was not here until I added it, is there a reason for that? */
identity.setTrust(db,
trustee, value, comment);
Modified: trunk/plugins/WoT/WoT.java
===================================================================
--- trunk/plugins/WoT/WoT.java 2008-11-10 02:23:33 UTC (rev 23460)
+++ trunk/plugins/WoT/WoT.java 2008-11-10 02:30:11 UTC (rev 23461)
@@ -787,7 +787,7 @@
} catch (UnknownIdentityException e) { // Create it.
try {
// Create the seed identity
- seed = new Identity(new
FreenetURI(seedURI), "Fetching seed identity...", true);
+ seed = new Identity(new
FreenetURI(seedURI), null, true);
// Step down to previous edition as the
Fetcher is gonna try to fetch next edition
seed.setEdition(seed.getRequestURI().getSuggestedEdition() - 1);
} catch (Exception e1) { // Should never happen