forked from I2P_Developers/i2p.i2p
2005-12-19 jrandom
* Fix for old Syndie blog bookmarks (thanks Complication!)
* Fix for I2PSnark to accept incoming connections again (oops)
* Randomize the order that peers from the tracker are contacted
This commit is contained in:
@@ -49,7 +49,8 @@ public class User {
|
||||
|
||||
private static final String DEFAULT_FAVORITE_TAGS[] = {
|
||||
"syndie", "syndie.tech", "syndie.intro", "syndie.bugs", "syndie.featurerequest", "syndie.announce",
|
||||
"i2p", "i2p.tech", "i2p.bugs", "i2p.i2phex", "i2p.susimail", "i2p.irc",
|
||||
"i2p", "i2p.tech", "i2p.bugs", "i2p.i2phex", "i2p.susimail", "i2p.irc",
|
||||
"bt.i2psnark", "bt.i2prufus", "bt.i2p-bt", "bt.azureus", "bt.misc",
|
||||
"security.misc",
|
||||
"chat",
|
||||
"test"
|
||||
|
||||
@@ -330,7 +330,8 @@ public abstract class BaseServlet extends HttpServlet {
|
||||
(AddressesServlet.ACTION_DELETE_OTHER.equals(action)) ||
|
||||
(AddressesServlet.ACTION_DELETE_TAG.equals(action)) ||
|
||||
(AddressesServlet.ACTION_DELETE_PEER.equals(action)) ) {
|
||||
PetName pn = user.getPetNameDB().getByName(req.getParameter(AddressesServlet.PARAM_NAME));
|
||||
String name = req.getParameter(AddressesServlet.PARAM_NAME);
|
||||
PetName pn = user.getPetNameDB().getByName(name);
|
||||
if (pn != null) {
|
||||
user.getPetNameDB().remove(pn);
|
||||
BlogManager.instance().saveUser(user);
|
||||
@@ -580,7 +581,7 @@ public abstract class BaseServlet extends HttpServlet {
|
||||
//out.write("<tr class=\"topNav\"><td class=\"topNav_user\" colspan=\"2\" nowrap=\"true\">\n");
|
||||
out.write("<tr class=\"topNav\"><td colspan=\"3\" nowrap=\"true\"><span class=\"topNav_user\">\n");
|
||||
out.write("<!-- nav bar begin -->\n");
|
||||
out.write("<a href=\"threads.jsp\" title=\"Syndie home\">Home</a> <a href=\"blogs.jsp\" title=\"Blog summary\">Blogs</a> ");
|
||||
out.write("<a href=\"threads.jsp\" title=\"Syndie home\">Threads</a> <a href=\"blogs.jsp\" title=\"Blog summary\">Blogs</a> ");
|
||||
if (user.getAuthenticated() && (user.getBlog() != null) ) {
|
||||
out.write("Logged in as <a href=\"" + getProfileLink(req, user.getBlog()) + "\" title=\"Edit your profile\">");
|
||||
out.write(user.getUsername());
|
||||
|
||||
@@ -26,8 +26,8 @@ public class ViewBlogsServlet extends BaseServlet {
|
||||
private String getViewBlogLink(Hash blog, long lastPost) {
|
||||
long dayBegin = BlogManager.instance().getDayBegin();
|
||||
int daysAgo = 2;
|
||||
if ( (lastPost > 0) && (dayBegin - 3*24*60*6081000 > lastPost) ) // last post was old 3 days ago
|
||||
daysAgo = (int)((dayBegin - lastPost + 24*60*60*1000-1)/(24*60*60*1000));
|
||||
if ( (lastPost > 0) && (dayBegin - 3*24*60*60*1000l >= lastPost) ) // last post was old 3 days ago
|
||||
daysAgo = (int)((dayBegin - lastPost + 24*60*60*1000l-1)/(24*60*60*1000l));
|
||||
daysAgo++;
|
||||
return getControlTarget() + "?" + ThreadedHTMLRenderer.PARAM_AUTHOR + '=' + blog.toBase64()
|
||||
+ '&' + ThreadedHTMLRenderer.PARAM_THREAD_AUTHOR + "=true&daysBack=" + daysAgo;
|
||||
@@ -65,7 +65,7 @@ public class ViewBlogsServlet extends BaseServlet {
|
||||
|
||||
out.write("<tr><td colspan=\"3\" valign=\"top\" align=\"left\"><span class=\"syndieBlogFavorites\">");
|
||||
if ( (user != null) && (user.getAuthenticated()) ) {
|
||||
out.write("<b>Favorite blogs:</b><br />\n");
|
||||
out.write("<b>Favorite blogs:</b> <a href=\"" + getControlTarget() + "?author=favorites&daysBack=3\" title=\"View all posts by your favorite authors in the last 3 days\">view all</a><br />\n");
|
||||
out.write("<a href=\"" + getViewBlogLink(user.getBlog(), user.getLastMetaEntry())
|
||||
+ "\" title=\"View your blog\">Your blog</a><br />\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user