diff --git a/src/Routes/Root.c b/src/Routes/Root.c index 98e8745..db57b7e 100644 --- a/src/Routes/Root.c +++ b/src/Routes/Root.c @@ -1,40 +1,98 @@ #include +#include +#include +#include + #include RouteHead(RouteRoot, arr, argp) { ParseeHttpArg *args = argp; + const char *quote = RandInt(2) ? + "Kinda jealous of that, to be fair." : + "Why look inward when you can challenge the mainstream media?"; + char *mxid, *jid; + char *m_to; + + mxid = ParseeMXID(args->data); + m_to = ParseeGenerateMTO(mxid); + jid = ParseeJID(args->data); HttpResponseHeader(args->ctx, "Content-Type", "text/html"); HttpSendHeaders(args->ctx); - StreamPrintf(args->stream, ""); - StreamPrintf(args->stream, " "); - StreamPrintf(args->stream, " Parsee Lander"); - StreamPrintf(args->stream, " "); - StreamPrintf(args->stream, " "); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, " Your Parsee is running!"); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, "
"); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, " Kinda jealous of that, to be "); - StreamPrintf(args->stream, " fair."); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, " Your homeserver now can interact"); - StreamPrintf(args->stream, " with the bridge, with the "); - StreamPrintf(args->stream, " generated YAML file."); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, " More information available at "); - StreamPrintf(args->stream, " stream, " >the actual page."); - StreamPrintf(args->stream, "

"); - StreamPrintf(args->stream, " "); - StreamPrintf(args->stream, " "); - StreamPrintf(args->stream, ""); +#define P(...) StreamPrintf(args->stream, __VA_ARGS__) + P(""); + P(" "); + P(" %s Lander", NAME); + P(" "); + P(" "); + P(" "); + P("

"); + P(" Your %s is running!", NAME); + P("

"); + P("
"); + P("
"); + P(" %s", quote); + P("
"); + P("

"); + P(" Your homeserver now can interact with the bridge, with "); + P(" the generated YAML file and Jabber component shared "); + P(" secret."); + P("

"); + P("

"); + P(" You may be interested in sending !help to "); + P(" the Matrix %s bridge, or pop out ", m_to, NAME); + P(" %s's command list on XMPP as a starter.", jid); + P("

"); + P("

"); + P(" More information available at "); + P(" the actual page."); + P("

"); + + P("

Extra information

"); + P("

"); + P("

Parsee statistics

"); + P("
");
+    P("Software: %s (v%s/Cyto %s)\n", NAME, VERSION, CytoplasmGetVersionStr());
+    P("Cytoplasm heap used: %d B\n", MemoryAllocated());
+    P("
"); + P("

"); + P("

"); + P(" Some clicky links relating to %s:", NAME); + P("

    "); + P("
  • Repository
  • ", REPOSITORY); + P("
  • Fediverse
  • ", "https://ak.ari.lt/parsee"); + P("
  • ", "https://kappach.at/parsee.gif"); + P("
"); + P("

"); + P("

"); + P(" Good luck, and have fun! :D"); + P("

"); + P("

—LDA

"); + P(" "); + P(""); +#undef P + + Free(mxid); + Free(m_to); + Free(jid); return NULL; }