[MOD/FIX] Set history limit, change logo, CI

This commit is contained in:
LDA 2024-09-10 21:47:08 +02:00
commit 696def187c
5 changed files with 25 additions and 10 deletions

View file

@ -14,7 +14,7 @@ char *
ASUpload(const ParseeConfig *c, Stream *from, unsigned int size, char *mime) ASUpload(const ParseeConfig *c, Stream *from, unsigned int size, char *mime)
{ {
char *size_str, *path, *ret, *user; char *size_str, *path, *ret, *user;
int i; unsigned int i;
HttpClientContext *ctx; HttpClientContext *ctx;
HashMap *reply; HashMap *reply;
if (!c || !from) if (!c || !from)

View file

@ -4,11 +4,10 @@
const char *parsee_ascii[PARSEE_ASCII_LINES] = const char *parsee_ascii[PARSEE_ASCII_LINES] =
{ {
"----------------------------",
" =+======", " =+======",
" || | _ _/__----", " || | _ _/__----",
" / || \\ ==+= _/_____\\_", " / || \\ ==+= _/_____\\_",
" | || | -|- L___J", " | || | -|- L___J ",
"_/ || \\_ ||| .______\\", "_/ || \\_ ||| .______\\",
" || | | | |.____.|", " || | | | |.____.|",
" || / | \\ |L____||", " || / | \\ |L____||",

View file

@ -84,11 +84,14 @@ RouteHead(RouteRoot, arr, argp)
P("color: #eee;"); P("color: #eee;");
P("font-family: sans-serif;"); P("font-family: sans-serif;");
P("}"); P("}");
P("#cols {"); P("#ascii {");
P("column-count: 3;"); P("text-align: center;");
P("min-width: 100%;"); P("color: #be1337;");
P("max-width: 100%;"); P("font-size: 4vw;");
P("width: 100%;"); P("}");
P("#ascii pre {");
P("display: inline-block;");
P("text-align: left;");
P("}"); P("}");
P("img {"); P("img {");
P("image-rendering: pixelated;"); P("image-rendering: pixelated;");
@ -115,6 +118,7 @@ RouteHead(RouteRoot, arr, argp)
P("<body>"); P("<body>");
{ {
size_t i;
P("<center>"); P("<center>");
P("<h1>Your %s is running, all with that %s!</h1>", NAME, CODE); P("<h1>Your %s is running, all with that %s!</h1>", NAME, CODE);
P("</center>"); P("</center>");
@ -124,6 +128,15 @@ RouteHead(RouteRoot, arr, argp)
P("%s", GetRandomQuote()); P("%s", GetRandomQuote());
} }
P("</i></blockquote>"); P("</i></blockquote>");
P("<pre id='ascii'><code>");
for (i = 0; i < PARSEE_ASCII_LINES; i++)
{
XMLElement *e = XMLCreateText(parsee_ascii[i]);
XMLEncode(args->stream, e);
XMLFreeElement(e);
P("<br/>");
}
P("</code></pre>");
P("<p>"); P("<p>");
{ {

View file

@ -170,7 +170,7 @@ XMPPRequestVoice(XMPPComponent *jabber, char *from, char *muc)
bool bool
XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, bool care) XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, bool care)
{ {
XMLElement *presence, *x, *reply; XMLElement *presence, *x, *reply, *history;
char *from, *id; char *from, *id;
if (!comp || !fr || !muc) if (!comp || !fr || !muc)
{ {
@ -185,6 +185,9 @@ XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, bool care)
XMLAddAttr(presence, "to", muc); XMLAddAttr(presence, "to", muc);
XMLAddAttr(presence, "id", (id = StrRandom(8))); XMLAddAttr(presence, "id", (id = StrRandom(8)));
XMLAddAttr(x, "xmlns", "http://jabber.org/protocol/muc"); XMLAddAttr(x, "xmlns", "http://jabber.org/protocol/muc");
history = XMLCreateTag("history");
XMLAddAttr(history, "seconds", "3600"); /* TODO: Custom timeout */
XMLAddChild(x, history);
XMLAddChild(presence, x); XMLAddChild(presence, x);
XMPPAnnotatePresence(presence); XMPPAnnotatePresence(presence);

View file

@ -101,7 +101,7 @@ typedef struct Argument {
extern const char media_parsee_logo[]; extern const char media_parsee_logo[];
/* An ASCII-art rendition of "小橋" */ /* An ASCII-art rendition of "小橋" */
#define PARSEE_ASCII_LINES 9 #define PARSEE_ASCII_LINES 8
extern const char *parsee_ascii[PARSEE_ASCII_LINES]; extern const char *parsee_ascii[PARSEE_ASCII_LINES];
/** /**