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
|
|
@ -10,6 +10,10 @@ The name 'Parsee' is actually a reference to [Parsee Mizuhashi](https://en.touho
|
||||||
I hate Bifrost. I also wanted to dip my toes in XMPP, XML, and bridges a bit. Also, as a sister project to KappaChat,
|
I hate Bifrost. I also wanted to dip my toes in XMPP, XML, and bridges a bit. Also, as a sister project to KappaChat,
|
||||||
this means that I can integrate Parsee with KappaChat however I wish it to be, which allows me to mess around with a
|
this means that I can integrate Parsee with KappaChat however I wish it to be, which allows me to mess around with a
|
||||||
codebase I'm already familiar with.
|
codebase I'm already familiar with.
|
||||||
|
A more "up-to-date" reason may be to have a small, 'Just Werks' bridging solution *that is good*.
|
||||||
|
Well, I'm *trying* to do that, at least. Please scream at me if that fails(or just doesn't run
|
||||||
|
on a overclocked Raspberry Pi 4B, which, by the way, was literally where Parsee+XMPP ran for
|
||||||
|
a good chunk of Parsee's start.)
|
||||||
|
|
||||||
### "Why not just use Matrix lol"
|
### "Why not just use Matrix lol"
|
||||||
### "Why not just use XMPP lol"
|
### "Why not just use XMPP lol"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include <Cytoplasm/Cytoplasm.h>
|
#include <Cytoplasm/Cytoplasm.h>
|
||||||
#include <Cytoplasm/Memory.h>
|
#include <Cytoplasm/Memory.h>
|
||||||
#include <Cytoplasm/Rand.h>
|
#include <Cytoplasm/Rand.h>
|
||||||
|
#include <Cytoplasm/Log.h>
|
||||||
|
|
||||||
#include <AS.h>
|
#include <AS.h>
|
||||||
|
|
||||||
|
|
@ -25,6 +26,34 @@ HasAdmin(ParseeData *data)
|
||||||
return ret;
|
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)
|
RouteHead(RouteRoot, arr, argp)
|
||||||
{
|
{
|
||||||
ParseeHttpArg *args = argp;
|
ParseeHttpArg *args = argp;
|
||||||
|
|
@ -39,6 +68,7 @@ RouteHead(RouteRoot, arr, argp)
|
||||||
P("<head>");
|
P("<head>");
|
||||||
{
|
{
|
||||||
P("<title>%s Lander</title>", NAME);
|
P("<title>%s Lander</title>", NAME);
|
||||||
|
P("<meta charset='UTF-8'/>");
|
||||||
P("<style>");
|
P("<style>");
|
||||||
{
|
{
|
||||||
P("html {");
|
P("html {");
|
||||||
|
|
@ -69,16 +99,12 @@ RouteHead(RouteRoot, arr, argp)
|
||||||
P("<body>");
|
P("<body>");
|
||||||
{
|
{
|
||||||
P("<center><h1>");
|
P("<center><h1>");
|
||||||
P("Your %s is running!", NAME);
|
P("Your %s is running, all with that %s!", NAME, CODE);
|
||||||
P("</h1></center>");
|
P("</h1></center>");
|
||||||
P("<hr/>");
|
P("<hr/>");
|
||||||
P("<blockquote><i>");
|
P("<blockquote><i>");
|
||||||
{
|
{
|
||||||
const char *quote = RandInt(2) ?
|
P("%s", GetRandomQuote());
|
||||||
"Kinda jealous of that, to be fair." :
|
|
||||||
"Why look inward when you can challenge the mainstream "
|
|
||||||
"media?";
|
|
||||||
P("%s", quote);
|
|
||||||
}
|
}
|
||||||
P("</i></blockquote>");
|
P("</i></blockquote>");
|
||||||
|
|
||||||
|
|
@ -138,9 +164,10 @@ RouteHead(RouteRoot, arr, argp)
|
||||||
|
|
||||||
P("<p>");
|
P("<p>");
|
||||||
{
|
{
|
||||||
P("If you happen to have a build-from-source copy of %s, ", NAME);
|
P("With a packaged and installed version of %s, ", NAME);
|
||||||
P("please build all utilities and run ");
|
P("you may add an admin with ");
|
||||||
P("<code>tools/out/adminify '%s' '[glob]'</code>.", config->db_path);
|
P("<code>parsee-adminify '%s' '[glob]'</code>. ", config->db_path);
|
||||||
|
P("Please see its manual page for more information.");
|
||||||
}
|
}
|
||||||
P("</p>");
|
P("</p>");
|
||||||
|
|
||||||
|
|
@ -150,7 +177,7 @@ RouteHead(RouteRoot, arr, argp)
|
||||||
P("<h3>Dev documentations!!!!</h3>");
|
P("<h3>Dev documentations!!!!</h3>");
|
||||||
P("Developers may be interested into looking up the ");
|
P("Developers may be interested into looking up the ");
|
||||||
P("<a href='https://at.kappach.at'>at.kappach.at</a> ");
|
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>");
|
P("</p>");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ ParseeInitialiseSignals(HttpServer *s, pthread_t xmpp, XMPPComponent *j)
|
||||||
#define Register(act) (sigaction(act, &sa, NULL) >= 0)
|
#define Register(act) (sigaction(act, &sa, NULL) >= 0)
|
||||||
if (!Register(SIGTERM) || !Register(SIGINT))
|
if (!Register(SIGTERM) || !Register(SIGINT))
|
||||||
{
|
{
|
||||||
|
Log(LOG_ERR, "Couldn't register signals...");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#undef Register
|
#undef Register
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue