[FIX/WIP] Fix crash, verify room filtering
Some checks are pending
Compile Telodendria / Compile Telodendria (x86, alpine-v3.19) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, debian-v12.4) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, freebsd-v14.0) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, netbsd-v9.3) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, alpine-v3.19) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, debian-v12.4) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, freebsd-v14.0) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, netbsd-v9.3) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, openbsd-v7.4) (push) Waiting to run

Sorry for not contributing that much, currently busy on another
project... I should implement more filtering later on.
This commit is contained in:
LDA 2024-07-19 16:56:24 +02:00
parent 7825559f1b
commit d46e418ec1

View file

@ -78,7 +78,7 @@ IsRoomFiltered(Filter *filter, char *roomID)
}
}
/* TODO: Consider rooms */
return true;
return false;
}
ROUTE_IMPL(RouteSync, path, argp)
@ -137,7 +137,7 @@ ROUTE_IMPL(RouteSync, path, argp)
prevBatch = HashMapGet(params, "since");
timeout = HashMapGet(params, "timeout");
filter = HashMapGet(params, "filter");
timeoutDuration = atoi(timeout);
timeoutDuration = timeout ? atoi(timeout) : 0;
if (filter && *filter != '{')
{
@ -225,14 +225,14 @@ ROUTE_IMPL(RouteSync, path, argp)
{
/* TODO: Rename these variables */
char *roomId = ArrayGet(joins, i);
JoinedRooms joined = { 0 };
char *firstEvent = NULL;
char *type, *key, *id;
HashMap *joinedObj;
HashMap *state;
Array *el;
size_t j;
Room *r;
HashMap *state;
char *firstEvent = NULL;
JoinedRooms joined = { 0 };
HashMap *joinedObj;
char *type, *key, *id;
if (IsRoomFiltered(&filterData, roomId))
{