Changeset d35f260


Ignore:
Timestamp:
May 24, 2017 12:47:24 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
13d9322
Parents:
7338b79e
Message:

Console: Don't show add-to-addressbook link for local unpublished clients

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java

    r7338b79e rd35f260  
    311311            if (_context.clientManager().isLocal(dest)) {
    312312                buf.append("<th><b><a href=\"tunnels#" + key.toBase64().substring(0,4) + "\">" + _t("Local") + "</a> ");
    313                 if (! _context.clientManager().shouldPublishLeaseSet(key))
     313                boolean unpublished = ! _context.clientManager().shouldPublishLeaseSet(key);
     314                if (unpublished)
    314315                    buf.append(_t("Unpublished") + ' ');
    315316                buf.append("<b>").append(_t("Destination")).append(":</b> ");
     
    322323                String b32 = dest.toBase32();
    323324                buf.append("<a href=\"http://").append(b32).append("\">").append(b32).append("</a></td>");
    324                 String host = _context.namingService().reverseLookup(dest);
    325                 if (host == null) {
    326                     buf.append("<td>").append("<a title=\"").append(_t("Add to addressbook"))
    327                        .append("\" href=\"/susidns/addressbook.jsp?book=private&amp;destination=")
    328                        .append(dest.toBase64()).append("#add\">").append(_t("Add to local addressbook")).append("</a></td>");
    329                 }
     325                if (!unpublished) {
     326                    String host = _context.namingService().reverseLookup(dest);
     327                    if (host == null) {
     328                        buf.append("<td>").append("<a title=\"").append(_t("Add to addressbook"))
     329                           .append("\" href=\"/susidns/addressbook.jsp?book=private&amp;destination=")
     330                           .append(dest.toBase64()).append("#add\">").append(_t("Add to local addressbook")).append("</a></td>");
     331                    }
     332                } // else probably a client
    330333            } else {
    331334                buf.append("<th><b>").append(_t("Destination")).append(":</b> ");
Note: See TracChangeset for help on using the changeset viewer.