forked from I2P_Developers/i2p.i2p
Compare commits
3 Commits
i2p-2.5.0-
...
i2p-2.5.0-
Author | SHA1 | Date | |
---|---|---|---|
9ef268796b | |||
32167c5f8f | |||
d123aeab0c |
@ -196,7 +196,7 @@ public class Folder<O extends Object> {
|
||||
*
|
||||
* @param elements Array of Os.
|
||||
*/
|
||||
public synchronized void setElements( O[] elements )
|
||||
private synchronized void setElements( O[] elements )
|
||||
{
|
||||
if (elements.length > 0) {
|
||||
this.elements = elements;
|
||||
@ -392,7 +392,9 @@ public class Folder<O extends Object> {
|
||||
*/
|
||||
public synchronized void setSortBy(String id, SortOrder direction)
|
||||
{
|
||||
SortOrder oldDirection = sortingDirection;
|
||||
sortingDirection = direction;
|
||||
Comparator<O> oldSorter = currentSorter;
|
||||
currentSorter = sorter.get( id );
|
||||
if (currentSorter != null) {
|
||||
if (sortingDirection == SortOrder.UP)
|
||||
@ -401,6 +403,11 @@ public class Folder<O extends Object> {
|
||||
} else {
|
||||
currentSortID = null;
|
||||
}
|
||||
// invalidate selection if sort order changed
|
||||
if (oldDirection != sortingDirection || !DataHelper.eq(oldSorter, currentSorter)) {
|
||||
currentSelector = null;
|
||||
selected = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -546,6 +553,7 @@ public class Folder<O extends Object> {
|
||||
*
|
||||
* @param element
|
||||
* @return The next element
|
||||
* @since 0.9.63
|
||||
*/
|
||||
public synchronized O getNextSelectedElement(O element)
|
||||
{
|
||||
@ -566,6 +574,7 @@ public class Folder<O extends Object> {
|
||||
*
|
||||
* @param element
|
||||
* @return The previous element
|
||||
* @since 0.9.63
|
||||
*/
|
||||
public synchronized O getPreviousSelectedElement(O element)
|
||||
{
|
||||
|
@ -60,6 +60,7 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.io.Writer;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -147,7 +148,7 @@ public class WebMail extends HttpServlet
|
||||
private static final String NEXT_PAGE_NUM = "nextpagenum";
|
||||
private static final String CURRENT_SORT = "currentsort";
|
||||
private static final String CURRENT_FOLDER = "folder";
|
||||
private static final String CURRENT_SEARCH = "currentsearch";
|
||||
private static final String CURRENT_SEARCH = "nf_currentsearch";
|
||||
private static final String NEW_FOLDER = "newfolder";
|
||||
private static final String DRAFT_EXISTS = "draftexists";
|
||||
private static final String DEBUG_STATE = "currentstate";
|
||||
@ -170,7 +171,7 @@ public class WebMail extends HttpServlet
|
||||
private static final String REALLYDELETE = "really_delete";
|
||||
private static final String MOVE_TO = "moveto";
|
||||
private static final String SWITCH_TO = "switchto";
|
||||
private static final String SEARCH = "s";
|
||||
private static final String SEARCH = "nf_s";
|
||||
// also a GET param
|
||||
private static final String SHOW = "show";
|
||||
private static final String DOWNLOAD = "download";
|
||||
@ -444,11 +445,12 @@ public class WebMail extends HttpServlet
|
||||
*
|
||||
* @param name
|
||||
* @param label
|
||||
* @param search may be null
|
||||
* @return the string
|
||||
*/
|
||||
private static String sortHeader(String name, String label, String imgPath,
|
||||
String currentName, SortOrder currentOrder, int page,
|
||||
String folder)
|
||||
String folder, String search)
|
||||
{
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
buf.append(label).append(" ");
|
||||
@ -457,7 +459,13 @@ public class WebMail extends HttpServlet
|
||||
buf.append("<img class=\"sort\" src=\"").append(imgPath).append("3up.png\" border=\"0\" alt=\"^\">\n");
|
||||
} else {
|
||||
buf.append("<a class=\"sort\" href=\"").append(myself).append("?page=").append(page).append("&sort=-")
|
||||
.append(name).append("&folder=").append(folder).append("\">");
|
||||
.append(name).append("&folder=").append(folder);
|
||||
if (search != null) {
|
||||
try {
|
||||
buf.append("&").append(SEARCH).append('=').append(URLEncoder.encode(search, "UTF-8"));
|
||||
} catch (UnsupportedEncodingException uee) {}
|
||||
}
|
||||
buf.append("\">");
|
||||
buf.append("<img class=\"sort\" src=\"").append(imgPath).append("3up.png\" border=\"0\" alt=\"^\">");
|
||||
buf.append("</a>\n");
|
||||
}
|
||||
@ -465,7 +473,13 @@ public class WebMail extends HttpServlet
|
||||
buf.append("<img class=\"sort\" src=\"").append(imgPath).append("3down.png\" border=\"0\" alt=\"v\">");
|
||||
} else {
|
||||
buf.append("<a class=\"sort\" href=\"").append(myself).append("?page=").append(page).append("&sort=")
|
||||
.append(name).append("&folder=").append(folder).append("\">");
|
||||
.append(name).append("&folder=").append(folder);
|
||||
if (search != null) {
|
||||
try {
|
||||
buf.append("&").append(SEARCH).append('=').append(URLEncoder.encode(search, "UTF-8"));
|
||||
} catch (UnsupportedEncodingException uee) {}
|
||||
}
|
||||
buf.append("\">");
|
||||
buf.append("<img class=\"sort\" src=\"").append(imgPath).append("3down.png\" border=\"0\" alt=\"v\">");
|
||||
buf.append("</a>");
|
||||
}
|
||||
@ -2394,6 +2408,9 @@ public class WebMail extends HttpServlet
|
||||
// always go to inbox after SEND
|
||||
if (str != null && !str.equals(DIR_FOLDER) && !buttonPressed(request, SEND))
|
||||
q += '&' + CURRENT_FOLDER + '=' + str;
|
||||
str = request.getParameter(SEARCH);
|
||||
if (str != null && str.length() > 0)
|
||||
q += '&' + SEARCH + '=' + URLEncoder.encode(str, "UTF-8");
|
||||
sendRedirect(httpRequest, response, q);
|
||||
return;
|
||||
}
|
||||
@ -3598,6 +3615,8 @@ public class WebMail extends HttpServlet
|
||||
// form 3
|
||||
out.print(form);
|
||||
out.print(hidden);
|
||||
if (search != null)
|
||||
out.println("<input type=\"hidden\" name=\"" + SEARCH + "\" value=\"" + DataHelper.escapeHTML(search) + "\">");
|
||||
showPageButtons(out, sessionObject.user, folderName, page, folder.getPages(), true);
|
||||
out.println("</form>");
|
||||
out.println("</div>");
|
||||
@ -3607,11 +3626,11 @@ public class WebMail extends HttpServlet
|
||||
out.print(hidden);
|
||||
out.println("<table id=\"mailbox\" cellspacing=\"0\" cellpadding=\"5\">\n");
|
||||
out.println("<tr><td colspan=\"9\"><hr></td></tr>\n<tr><th title=\"" + _t("Mark for deletion") + "\"> </th>" +
|
||||
thSpacer + "<th>" + sortHeader(SORT_SENDER, showToColumn ? _t("To") : _t("From"), sessionObject.imgPath, curSort, curOrder, page, folderName) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader(SORT_SUBJECT, _t("Subject"), sessionObject.imgPath, curSort, curOrder, page, folderName) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader(SORT_DATE, _t("Date"), sessionObject.imgPath, curSort, curOrder, page, folderName) +
|
||||
thSpacer + "<th>" + sortHeader(SORT_SENDER, showToColumn ? _t("To") : _t("From"), sessionObject.imgPath, curSort, curOrder, page, folderName, search) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader(SORT_SUBJECT, _t("Subject"), sessionObject.imgPath, curSort, curOrder, page, folderName, search) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader(SORT_DATE, _t("Date"), sessionObject.imgPath, curSort, curOrder, page, folderName, search) +
|
||||
"</th>" +
|
||||
thSpacer + "<th>" + sortHeader(SORT_SIZE, _t("Size"), sessionObject.imgPath, curSort, curOrder, page, folderName) + "</th></tr>" );
|
||||
thSpacer + "<th>" + sortHeader(SORT_SIZE, _t("Size"), sessionObject.imgPath, curSort, curOrder, page, folderName, search) + "</th></tr>" );
|
||||
int bg = 0;
|
||||
int i = 0;
|
||||
for (Iterator<String> it = folder.currentPageSelectorIterator(); it != null && it.hasNext(); ) {
|
||||
@ -3734,6 +3753,8 @@ public class WebMail extends HttpServlet
|
||||
// form 5
|
||||
out.print(form);
|
||||
out.print(hidden);
|
||||
if (search != null)
|
||||
out.println("<input type=\"hidden\" name=\"" + SEARCH + "\" value=\"" + DataHelper.escapeHTML(search) + "\">");
|
||||
showPageButtons(out, sessionObject.user, folderName, page, folder.getPages(), false);
|
||||
out.println("</form>");
|
||||
out.println("</div>");
|
||||
|
@ -1,3 +1,9 @@
|
||||
2024-04-27 zzz
|
||||
* Sybil: Disable IP checks for now
|
||||
|
||||
2024-04-26 zzz
|
||||
* Susimail: Search fixes
|
||||
|
||||
2024-04-25 zzz
|
||||
* Susimail: Add search box (Gitlab MR !190)
|
||||
* Transport: Remove SSU1 code from IMF/IMS (Gitlab MRs !189)
|
||||
|
@ -20,7 +20,7 @@ public class RouterVersion {
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
/** for example: "beta", "alpha", "rc" */
|
||||
public final static String QUALIFIER = "";
|
||||
public final static long BUILD = 2;
|
||||
public final static long BUILD = 3;
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
public final static String FULL_VERSION = VERSION + "-" + BUILD + QUALIFIER + EXTRA;
|
||||
|
@ -401,11 +401,11 @@ public class Analysis extends JobImpl implements RouterApp, Runnable {
|
||||
// unused here, just for the console, so use the same for all of them
|
||||
List<RouterInfo> dummy = new DummyList();
|
||||
calculateIPGroupsUs(ris, points, dummy, dummy, dummy, dummy, dummy);
|
||||
calculateIPGroups32(ris, points);
|
||||
calculateIPGroups24(ris, points);
|
||||
calculateIPGroups16(ris, points);
|
||||
calculateIPGroups64(ris, points);
|
||||
calculateIPGroups48(ris, points);
|
||||
//calculateIPGroups32(ris, points);
|
||||
//calculateIPGroups24(ris, points);
|
||||
//calculateIPGroups16(ris, points);
|
||||
//calculateIPGroups64(ris, points);
|
||||
//calculateIPGroups48(ris, points);
|
||||
|
||||
// Pairwise distance analysis
|
||||
// O(n**2)
|
||||
|
@ -27,12 +27,14 @@ import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.router.Blocklist;
|
||||
import net.i2p.router.RouterVersion;
|
||||
import net.i2p.update.UpdateManager;
|
||||
import net.i2p.update.UpdateType;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.FileSuffixFilter;
|
||||
import net.i2p.util.SecureDirectory;
|
||||
import net.i2p.util.SecureFileOutputStream;
|
||||
import net.i2p.util.VersionComparator;
|
||||
|
||||
/**
|
||||
* Store and retrieve analysis files from disk.
|
||||
@ -256,6 +258,14 @@ public class PersistSybil {
|
||||
*/
|
||||
Map<String, Long> readBlocklist() {
|
||||
File f = getBlocklistFile();
|
||||
String prev = _context.getProperty("router.previousFullVersion");
|
||||
if (prev != null &&
|
||||
VersionComparator.comp(prev, "2.5.0-3") < 0 &&
|
||||
VersionComparator.comp(RouterVersion.FULL_VERSION, "2.5.0-3") >= 0) {
|
||||
// clear out and start over
|
||||
f.delete();
|
||||
return null;
|
||||
}
|
||||
Map<String, Long> rv = readBlocklist(f);
|
||||
if (rv != null)
|
||||
notifyVersion(f.lastModified());
|
||||
|
Reference in New Issue
Block a user