Skip to content

Commit

Permalink
SusiDNS: Fix adding to empty address book
Browse files Browse the repository at this point in the history
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/
  • Loading branch information
zzzi2p authored and eyedeekay committed Sep 4, 2022
1 parent fcae435 commit b03811a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
16 changes: 14 additions & 2 deletions apps/susidns/src/jsp/addressbook.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
<h3 id="addrtitle"><%=intl._t("Address book")%>: <%=intl._t(book.getBook())%></h3>
<h4 id="storagepath"><%=intl._t("Storage")%>: ${book.displayName}</h4>

<%
// 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")) { %>
Expand Down Expand Up @@ -128,15 +135,18 @@ ${book.loadBookMessages}
</div>
</form>
<% } /* book.getEntries().length() > 0 */ %>
</c:if><% /* book.notEmpty */ %>

</div>
</div><% /* headline */ %>

<div id="messages">${book.messages}<%
<% /* need this whether book is empty or not to display the form messages */ %>
<div id="messages"><%=formMessages%><%
if (importMessages != null) {
%><%=importMessages%><%
}
%></div>

<c:if test="${book.notEmpty}">
<div id="filter">
<c:if test="${book.hasFilter}">
<span><%=intl._t("Current filter")%>: <b>${book.filter}</b>
Expand Down Expand Up @@ -287,10 +297,12 @@ ${book.loadBookMessages}
</table>
<p class="buttons" id="addnewaddrbutton">
<input class="cancel" type="reset" value="<%=intl._t("Cancel")%>" >
<c:if test="${book.notEmpty}">
<input class="accept" type="submit" name="action" value="<%=intl._t("Replace")%>" >
<% if (!book.getBook().equals("published")) { %>
<input class="add" type="submit" name="action" value="<%=intl._t("Add Alternate")%>" >
<% } %>
</c:if><% /* book.notEmpty */ %>
<input class="add" type="submit" name="action" value="<%=intl._t("Add")%>" >
</p>
</div>
Expand Down
29 changes: 29 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
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

2022-09-01 zzz
* Router: Ensure database store message is processed before reply job (Gitlab #364)

2022-08-29 zzz
* SSU2: Implement ack-immediate flag

2022-08-28 zzz
* Console:
- Add notification and summary bar info on deadlock
- Linkify router hash even if not in netdb
* Util: Add option to gzip router logs

2022-08-25 zzz
* Router: Fix deadlock via rebuildRouterAddress() and UDPTransport
* SSU2:
- Implement path challenge and connection migration
- Fix packets exceeding MTU by up to 3 bytes
- Immediately fail session request containing zero token

2022-08-23 zzz
* Router: Add deadlocks to event log

2022-08-22 1.9.0 released

2022-08-10 zzz
Expand Down
2 changes: 1 addition & 1 deletion router/java/src/net/i2p/router/RouterVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0;
public final static long BUILD = 6;

/** for example "-test" */
public final static String EXTRA = "";
Expand Down

0 comments on commit b03811a

Please sign in to comment.