jsoninfo: add Freifunk neighbours special case, like txtinfo
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 30 Nov 2015 20:37:23 +0000 (21:37 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 17:41:13 +0000 (18:41 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index d4b3878..f932ddc 100644 (file)
@@ -423,8 +423,16 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
           send_what |= SIW_CONFIG;
         if (strstr(requ, "/plugins"))
           send_what |= SIW_PLUGINS;
+
+        /* To print out neighbours only on the Freifunk Status
+         * page the normal output is somewhat lengthy. The
+         * header parsing is sufficient for standard wget.
+         */
+        if (strstr(requ, "/neighbours"))
+          send_what = SIW_NEIGHBORS | SIW_LINKS;
       }
     }
+
     if (!send_what)
       send_what = SIW_ALL;
   }