Gopher: menu/text fix for news step 2
[gofetch.git] / src / be / nikiroo / gofetch / Fetcher.java
index 7866fe0030acc87c73dc2775ff2fb432bf50a11a..9dbf0e10bf60d52daad2081f9c615d27dc19973d 100644 (file)
@@ -93,7 +93,7 @@ public class Fetcher {
                        }
                        ref = "../" + ref + "/index.html";
 
-                       htmlBuilder.append(getLink(support.getDescription(), ref, false,
+                       htmlBuilder.append(getLink(support.getDescription(), ref, true,
                                        true));
                }
 
@@ -227,10 +227,19 @@ public class Fetcher {
                }
        }
 
-       private String getLink(String name, String ref, boolean index, boolean html) {
+       /**
+        * 
+        * @param name
+        * @param ref
+        * @param menu
+        *            menu (gophermap, i) mode
+        * @param html
+        * @return
+        */
+       private String getLink(String name, String ref, boolean menu, boolean html) {
                if (!html) {
-                       return new StringBuilder().append("1" + name).append("\t")
-                                       .append(ref) //
+                       return new StringBuilder().append((menu ? "1" : "0") + name)
+                                       .append("\t").append(ref) //
                                        .append("\t").append(hostname) //
                                        .append("\t").append(Integer.toString(port)) //
                                        .append("\r\n").toString();