Fixed display of full Freetalk public identity in config.
diff --git a/readme.txt b/readme.txt --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -20110409 +20110429 djk@isFiaD04zgAgnrEC5XJt1i4IE7AkNPqhBG5bONi6Yks WARNING: @@ -88,7 +88,7 @@ BUG: Default FCP port wrong for CLI clie BUG: fix the discover UI to correctly handle posts from a different nym than the insert BUG: wikitext should use unix line terminators not DOS (+1 byte per line) BUG: MUST show in the UI when edited wikitext has been truncated because it's too big. - +BUG: Make Freetalk configuration work like fms configuration. i.e. no need for public key. --- IDEA: shrink blocks by using a token map? use short token in binary rep, fixup to full 20byte hash on read / write? *IDEA: Support links to other wikis. e.g.:b fniki://nntp/group/name[/SSK@some_version] @@ -115,7 +115,7 @@ IDEA: Wikibot ng. Just uses its FMS trus send a "Stake" biss message for it. IDEA: Freetalk vs Freenet interop 0) Group naming convention. anythingbutmul.foo.bar.baz -> mul.anythingbutmul.foo.bar.baz in freetalk - 1) fniki://groupname/wikiname -- same for both. Freetalk smtp code prefixes mul. to group + 1) fniki://groupname/wikiname -- same for both. Freetalk nntp code prefixes mul. to group 2) In config UI. add freetalk config and enable checkboxes for freeetalk and fms 3) Conventiton or config to choose which private key is used for SSK insertion. Hmmm... not sure if people would use this feature because of the correlation of ids. diff --git a/src/fniki/wiki/WikiApp.java b/src/fniki/wiki/WikiApp.java --- a/src/fniki/wiki/WikiApp.java +++ b/src/fniki/wiki/WikiApp.java @@ -385,7 +385,8 @@ public class WikiApp implements ChildCon public Configuration getDefaultConfiguration() { return DEFAULT_CONFIG; } public String getPublicFmsId(String fmsId, String privateSSK) { - if (fmsId == null || privateSSK == null || fmsId.indexOf("@") != -1) { + if (fmsId == null || privateSSK == null || + (fmsId.indexOf("@") != -1 && (!fmsId.endsWith(".freetalk")))) { return "???"; } try { @@ -395,7 +396,23 @@ public class WikiApp implements ChildCon if (pos == -1 || pos < 5) { return "???"; } - return fmsId + publicKey.substring("SSK".length(), pos); + + if (!fmsId.endsWith(".freetalk")) { + return fmsId + publicKey.substring("SSK".length(), pos); + } else { + int atPos = fmsId.indexOf("@"); + if (atPos == -1) { + return "???"; + } + + // LATER: Fix config to take only human readable id for Freetalk. + String invertedFmsId = fmsId.substring(0, atPos) + + publicKey.substring("SSK".length(), pos) + ".freetalk"; + if (!invertedFmsId.equals(fmsId)) { + return "???"; + } + return invertedFmsId; + } } catch (IllegalArgumentException iae) { // Was called with an invalid privateSSK value diff --git a/src/fniki/wiki/child/SettingConfig.java b/src/fniki/wiki/child/SettingConfig.java --- a/src/fniki/wiki/child/SettingConfig.java +++ b/src/fniki/wiki/child/SettingConfig.java @@ -30,7 +30,6 @@ import static ys.wikiparser.Utils.*; import wormarc.IOUtil; -import fniki.wiki.ArchiveManager; import fniki.wiki.ChildContainerException; import fniki.wiki.Configuration; import static fniki.wiki.HtmlUtils.*;