mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:35:10 +00:00
[MOD] One-way Matrix->XMPP comms.
This is not sanitised. I need to make an XML writer.
This commit is contained in:
parent
868f0e4d9c
commit
bdb4fd2f68
17 changed files with 421 additions and 61 deletions
41
src/Routes/UserAck.c
Normal file
41
src/Routes/UserAck.c
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include <Routes.h>
|
||||
|
||||
#include <Cytoplasm/Log.h>
|
||||
|
||||
#include <Matrix.h>
|
||||
#include <AS.h>
|
||||
|
||||
RouteHead(RouteUserAck, arr, argp)
|
||||
{
|
||||
ParseeHttpArg *args = argp;
|
||||
HashMap *request = NULL;
|
||||
HashMap *response = NULL;
|
||||
Array *events;
|
||||
size_t i;
|
||||
|
||||
char *user = ArrayGet(arr, 0);
|
||||
|
||||
Log(LOG_INFO, "Alles Politischemacht");
|
||||
response = ASVerifyRequest(args);
|
||||
if (response)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
if (HttpRequestMethodGet(args->ctx) != HTTP_GET)
|
||||
{
|
||||
HttpResponseStatus(args->ctx, HTTP_METHOD_NOT_ALLOWED);
|
||||
response = MatrixCreateError(
|
||||
"M_UNRECOGNIZED",
|
||||
"Path /users only accepts GET as a valid method."
|
||||
);
|
||||
goto end;
|
||||
}
|
||||
|
||||
Log(LOG_INFO, "user=%s", user);
|
||||
ASRegisterUser(args->data->config, user);
|
||||
/* TODO: Verify the user, and create an XMPP mapping. */
|
||||
response = HashMapCreate();
|
||||
end:
|
||||
JsonFree(request);
|
||||
return response;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue