mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 15:05:11 +00:00
[MOD] Quote-of-the-day changes
This commit is contained in:
parent
7c228fcc3d
commit
a8f1031a79
3 changed files with 42 additions and 10 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include <Cytoplasm/Cytoplasm.h>
|
||||
#include <Cytoplasm/Memory.h>
|
||||
#include <Cytoplasm/Rand.h>
|
||||
#include <Cytoplasm/Log.h>
|
||||
|
||||
#include <AS.h>
|
||||
|
||||
|
|
@ -25,6 +26,34 @@ HasAdmin(ParseeData *data)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static const char *
|
||||
GetRandomQuote(void)
|
||||
{
|
||||
const char *quotes[] =
|
||||
{
|
||||
"Kinda jealous of that, to be fair.",
|
||||
"*(noms)*",
|
||||
"Why look inward when you can challenge the mainstream "
|
||||
"media?",
|
||||
"Boo!",
|
||||
"[...] I can make up lots of reasons to attack you.",
|
||||
"Go Kontribute to C99 projects!",
|
||||
"We truly live in a " CODE "...",
|
||||
"You truly lack the Desire Drive for this!",
|
||||
"Eeh? Bifrost mode? Only bad servers use Bifrost mode!",
|
||||
"As small as a dwarf, and can run on your pie!",
|
||||
"It's all wicked unsafe, memory slow 🚀🚀🚀🚀",
|
||||
|
||||
"XMPP kinda sucks.",
|
||||
"Matrix kinda sucks.",
|
||||
|
||||
"Throw jabs!"
|
||||
};
|
||||
const size_t count = sizeof(quotes)/sizeof(*quotes);
|
||||
|
||||
return quotes[RandInt(count) % count];
|
||||
}
|
||||
|
||||
RouteHead(RouteRoot, arr, argp)
|
||||
{
|
||||
ParseeHttpArg *args = argp;
|
||||
|
|
@ -39,6 +68,7 @@ RouteHead(RouteRoot, arr, argp)
|
|||
P("<head>");
|
||||
{
|
||||
P("<title>%s Lander</title>", NAME);
|
||||
P("<meta charset='UTF-8'/>");
|
||||
P("<style>");
|
||||
{
|
||||
P("html {");
|
||||
|
|
@ -69,16 +99,12 @@ RouteHead(RouteRoot, arr, argp)
|
|||
P("<body>");
|
||||
{
|
||||
P("<center><h1>");
|
||||
P("Your %s is running!", NAME);
|
||||
P("Your %s is running, all with that %s!", NAME, CODE);
|
||||
P("</h1></center>");
|
||||
P("<hr/>");
|
||||
P("<blockquote><i>");
|
||||
{
|
||||
const char *quote = RandInt(2) ?
|
||||
"Kinda jealous of that, to be fair." :
|
||||
"Why look inward when you can challenge the mainstream "
|
||||
"media?";
|
||||
P("%s", quote);
|
||||
P("%s", GetRandomQuote());
|
||||
}
|
||||
P("</i></blockquote>");
|
||||
|
||||
|
|
@ -138,9 +164,10 @@ RouteHead(RouteRoot, arr, argp)
|
|||
|
||||
P("<p>");
|
||||
{
|
||||
P("If you happen to have a build-from-source copy of %s, ", NAME);
|
||||
P("please build all utilities and run ");
|
||||
P("<code>tools/out/adminify '%s' '[glob]'</code>.", config->db_path);
|
||||
P("With a packaged and installed version of %s, ", NAME);
|
||||
P("you may add an admin with ");
|
||||
P("<code>parsee-adminify '%s' '[glob]'</code>. ", config->db_path);
|
||||
P("Please see its manual page for more information.");
|
||||
}
|
||||
P("</p>");
|
||||
|
||||
|
|
@ -150,7 +177,7 @@ RouteHead(RouteRoot, arr, argp)
|
|||
P("<h3>Dev documentations!!!!</h3>");
|
||||
P("Developers may be interested into looking up the ");
|
||||
P("<a href='https://at.kappach.at'>at.kappach.at</a> ");
|
||||
P("page for extensions used by Parsee on Matrix. ");
|
||||
P("page for extensions used by Parsee on Matrix and XMPP. ");
|
||||
}
|
||||
P("</p>");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue