[ADD] Ping homeserver to see if Parsee works

This commit is contained in:
LDA 2024-11-17 16:22:10 +01:00
commit 5d13410ac4
5 changed files with 75 additions and 4 deletions

View file

@ -10,15 +10,16 @@
#include <Matrix.h>
void
bool
ASPing(const ParseeConfig *conf)
{
HttpClientContext *ctx = NULL;
HashMap *json = NULL;
char *path;
bool ret;
if (!conf)
{
return;
return false;
}
path = StrConcat(3,
@ -33,7 +34,9 @@ ASPing(const ParseeConfig *conf)
Free(path);
json = HashMapCreate();
ASAuthenticateRequest(conf, ctx);
ParseeSetRequestJSON(ctx, json);
ret = ParseeSetRequestJSON(ctx, json) == HTTP_OK;
HttpClientContextFree(ctx);
JsonFree(json);
return ret;
}