diff --git a/DATES.TXT b/DATES.TXT index 8e32ab3..f54dbc0 100644 --- a/DATES.TXT +++ b/DATES.TXT @@ -1,6 +1,6 @@ Some dates for Parsee-related events. They mostly serve as LDA's TODOs with a strict deadline: - - ~September 2024[star-of-hope]: + - ~September 2024[tomboyish-bridges-adventure]: Get Parsee into the _Phantasmagoria of Bug View_ stage (essentially v0.0.1 for a public testing) once I can afford `yama`, and start bridging the Matrix room alongside a shiny XMPP MUC, bridged by diff --git a/build.conf b/build.conf index fd384e4..3e8cbd7 100644 --- a/build.conf +++ b/build.conf @@ -1,4 +1,4 @@ -CODE=phantasmagoria +CODE=tomboyish-bridges-adventure NAME=Parsee -VERSION=0.0.0 +VERSION=0.0.1 BINARY=parsee diff --git a/src/Main.c b/src/Main.c index e99e627..760ca03 100644 --- a/src/Main.c +++ b/src/Main.c @@ -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); diff --git a/src/Parsee/Logo.c b/src/Parsee/Logo.c new file mode 100644 index 0000000..245a91c --- /dev/null +++ b/src/Parsee/Logo.c @@ -0,0 +1,26 @@ +#include + +#include + +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]); + } +} diff --git a/src/XMPPThread/Stanzas/Message.c b/src/XMPPThread/Stanzas/Message.c index f7230fb..53ce9c8 100644 --- a/src/XMPPThread/Stanzas/Message.c +++ b/src/XMPPThread/Stanzas/Message.c @@ -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); diff --git a/src/include/Parsee.h b/src/include/Parsee.h index dac1d9f..3b74997 100644 --- a/src/include/Parsee.h +++ b/src/include/Parsee.h @@ -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. * ------------