[MOD] Start preparing for an alpha

The (9)th.
This commit is contained in:
LDA 2024-09-01 21:19:24 +02:00
commit 34bd036ab7
6 changed files with 58 additions and 7 deletions

View file

@ -76,6 +76,7 @@ Main(Array *args, HashMap *env)
"%s - v%s[%s] (Cytoplasm %s)",
NAME, VERSION, CODE, CytoplasmGetVersionStr()
);
ParseePrintASCII();
Log(LOG_INFO, "=======================");
LogConfigIndent(LogConfigGlobal());
@ -224,8 +225,8 @@ Main(Array *args, HashMap *env)
}
Log(LOG_NOTICE, "Starting up local cronjobs...");
cron = CronCreate( 30 MINUTES );
CronEvery(cron, 1 HOURS, ParseeCleanup, conf.handlerArgs);
cron = CronCreate(10 SECONDS);
CronEvery(cron, 5 MINUTES, ParseeCleanup, conf.handlerArgs);
ParseeCleanup(conf.handlerArgs);
CronStart(cron);

26
src/Parsee/Logo.c Normal file
View file

@ -0,0 +1,26 @@
#include <Parsee.h>
#include <Cytoplasm/Log.h>
const char *parsee_ascii[PARSEE_ASCII_LINES] =
{
"----------------------------",
" =+======",
" || | _ _/__----",
" / || \\ ==+= _/_____\\_",
" | || | -|- L___J",
"_/ || \\_ ||| .______\\",
" || | | | |.____.|",
" || / | \\ |L____||",
" _// | | J"
};
void
ParseePrintASCII(void)
{
size_t i;
for (i = 0; i < PARSEE_ASCII_LINES; i++)
{
Log(LOG_INFO, "%s", parsee_ascii[i]);
}
}

View file

@ -385,11 +385,25 @@ end_error:
}
else if (replaced && data)
{
/* TODO: Unify these. Maybe even make a function
* that objectifies a stanza. */
size_t off =
reply_to ? ParseeFindDatastart(data->data) : 0;
HashMap *ev = ShoveStanza(
MatrixCreateReplace(event_id, data->data + off),
stanza
);
if (reply_to)
{
char *reply_id =
ParseeGetEventFromID(args, stanza, reply_to);
MatrixSetReply(ev, reply_id);
Free(reply_id);
}
event_id = ParseeGetEventFromID(args, stanza, replaced);
Free(ASSend(
args->config, mroom_id, encoded,
"m.room.message",
ShoveStanza(MatrixCreateReplace(event_id, data->data), stanza)
"m.room.message", ev
));
ParseePushAllStanza(args, stanza, event_id);
pthread_mutex_unlock(&thr->info->chk_lock);

View file

@ -100,6 +100,16 @@ typedef struct Argument {
/* A base64-encoded Parsee logo */
extern const char media_parsee_logo[];
/* An ASCII-art rendition of "小橋" */
#define PARSEE_ASCII_LINES 9
extern const char *parsee_ascii[PARSEE_ASCII_LINES];
/**
* Prints the Parsee ASCII logo.
* ------------
* Modifies: the logger output */
extern void ParseePrintASCII(void);
/** Generates a valid, getopt-style argument list from a end-terminated
* argument list.
* ------------