From 554b17fe9af74a6d08b148bb155ce7a3d7ca6a02 Mon Sep 17 00:00:00 2001 From: zzz Date: Sun, 4 Sep 2022 08:14:19 -0400 Subject: [PATCH] SusiDNS: Fix adding to empty address book by doing form processing even if book is empty. Do all form processing before displays so the displays reflect any form add/delete. Broken in 0.9.50 when form processing call was moved. Hide replace and add alternate buttons if book is empty. Ref: https://www.reddit.com/r/i2p/comments/wu7nac/how_do_i_add_to_the_private_address_book/ --- apps/susidns/src/jsp/addressbook.jsp | 16 ++++++++++++++-- history.txt | 3 +++ .../java/src/net/i2p/router/RouterVersion.java | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/susidns/src/jsp/addressbook.jsp b/apps/susidns/src/jsp/addressbook.jsp index fb1ce9295..db3f50b9d 100644 --- a/apps/susidns/src/jsp/addressbook.jsp +++ b/apps/susidns/src/jsp/addressbook.jsp @@ -77,6 +77,13 @@

<%=intl._t("Address book")%>: <%=intl._t(book.getBook())%>

<%=intl._t("Storage")%>: ${book.displayName}

+<% + // This is what does the form processing. + // We need to do this before any notEmpty test and before loadBookMessages() which displays the entry count. + // Messages will be displayed below. + String formMessages = book.getMessages(); +%> + ${book.loadBookMessages} <% if (book.getBook().equals("private")) { %> @@ -128,15 +135,18 @@ ${book.loadBookMessages} <% } /* book.getEntries().length() > 0 */ %> +<% /* book.notEmpty */ %> - +<% /* headline */ %> -
${book.messages}<% +<% /* need this whether book is empty or not to display the form messages */ %> +
<%=formMessages%><% if (importMessages != null) { %><%=importMessages%><% } %>
+
<%=intl._t("Current filter")%>: ${book.filter} @@ -287,10 +297,12 @@ ${book.loadBookMessages}

" > + " > <% if (!book.getBook().equals("published")) { %> " > <% } %> +<% /* book.notEmpty */ %> " >

diff --git a/history.txt b/history.txt index b467be0ed..93e72a3ba 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2022-09-04 zzz + * SusiDNS: Fix adding to empty address book + 2022-09-03 zzz * NetDB: Query connected peers for their RI directly * UPnP: Fix opening IPv6 ports diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 9bc4388a0..f2424bd3b 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Git"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 5; + public final static long BUILD = 6; /** for example "-test" */ public final static String EXTRA = "";