mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 13:45:10 +00:00
[ADD/MOD] XMPP->Matrix media bridge, small cleanup
This commit is contained in:
parent
4de7227ee7
commit
42d69226f0
14 changed files with 327 additions and 54 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <Cytoplasm/Cytoplasm.h>
|
||||
#include <Cytoplasm/Memory.h>
|
||||
#include <Cytoplasm/Util.h>
|
||||
#include <Cytoplasm/Cron.h>
|
||||
#include <Cytoplasm/Log.h>
|
||||
#include <Cytoplasm/Str.h>
|
||||
|
||||
|
|
@ -26,6 +27,7 @@ Main(void)
|
|||
ParseeData *data = NULL;
|
||||
const ParseeConfig *parsee_conf;
|
||||
Stream *yaml;
|
||||
Cron *cron = NULL;
|
||||
|
||||
Log(LOG_INFO,
|
||||
"%s - v%s (Cytoplasm %s)",
|
||||
|
|
@ -63,6 +65,7 @@ Main(void)
|
|||
Log(LOG_NOTICE, "Setting up local Matrix user...");
|
||||
ASRegisterUser(parsee_conf, parsee_conf->sender_localpart);
|
||||
|
||||
|
||||
memset(&conf, 0, sizeof(conf));
|
||||
conf.port = parsee_conf->port;
|
||||
conf.threads = 4;
|
||||
|
|
@ -70,6 +73,10 @@ Main(void)
|
|||
conf.handlerArgs = ParseeInitData(jabber);
|
||||
conf.handler = ParseeRequest;
|
||||
|
||||
Log(LOG_NOTICE, "Starting up local cronjobs...");
|
||||
cron = CronCreate( 10 SECONDS );
|
||||
CronEvery(cron, 30 MINUTES, ParseeCleanup, conf.handlerArgs);
|
||||
|
||||
Log(LOG_NOTICE, "Creating XMPP listener thread...");
|
||||
if (pthread_create(&xmpp_thr, NULL, ParseeXMPPThread, conf.handlerArgs))
|
||||
{
|
||||
|
|
@ -98,6 +105,8 @@ end:
|
|||
Log(LOG_INFO, "Exiting...");
|
||||
HttpServerFree(server);
|
||||
ParseeConfigFree();
|
||||
CronStop(cron);
|
||||
CronFree(cron);
|
||||
ParseeFreeData(conf.handlerArgs);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue