[MOD/WIP] Fix broken Cinny UIA and state changes
Some checks failed
Compile Telodendria / Compile Telodendria (x86, alpine-v3.19) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, debian-v12.4) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, freebsd-v14.0) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, netbsd-v9.3) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, alpine-v3.19) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, debian-v12.4) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, freebsd-v14.0) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, netbsd-v9.3) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, openbsd-v7.4) (push) Has been cancelled

This commit is contained in:
LDA 2024-08-15 11:00:58 +02:00
parent cc5c4bde70
commit acd1bf0ec0
3 changed files with 8 additions and 5 deletions

1
.gitignore vendored
View file

@ -16,3 +16,4 @@ contrib/.vagrant
src/Schema src/Schema
src/include/Schema src/include/Schema
man/mandoc.db man/mandoc.db
*swp

View file

@ -78,6 +78,7 @@ RouterBuild(void)
R("/_matrix/client/v3/rooms/(.*)/send/(.*)/(.*)", RouteSendEvent); R("/_matrix/client/v3/rooms/(.*)/send/(.*)/(.*)", RouteSendEvent);
R("/_matrix/client/v3/rooms/(.*)/state/(.*)/(.*)", RouteSendState); R("/_matrix/client/v3/rooms/(.*)/state/(.*)/(.*)", RouteSendState);
R("/_matrix/client/v3/rooms/(.*)/state/(.*)", RouteSendState);
R("/_matrix/client/v3/rooms/(.*)/event/(.*)", RouteFetchEvent); R("/_matrix/client/v3/rooms/(.*)/event/(.*)", RouteFetchEvent);
R("/_matrix/client/v3/rooms/(.*)/join", RouteJoinRoom); R("/_matrix/client/v3/rooms/(.*)/join", RouteJoinRoom);
R("/_matrix/client/v3/rooms/(.*)/messages", RouteMessages); R("/_matrix/client/v3/rooms/(.*)/messages", RouteMessages);

View file

@ -312,15 +312,16 @@ UiaComplete(Array * flows, HttpServerContext * context, Db * db,
} }
} }
/* TODO: The type may sometimes be omitted. */ /* TODO: The type may sometimes be omitted. This means it is implied
* from context. */
val = HashMapGet(auth, "type"); val = HashMapGet(auth, "type");
if (!val || JsonValueType(val) != JSON_STRING) if (!val || JsonValueType(val) != JSON_STRING)
{ {
msg = "'auth->type' is unset or not a string."; /* TODO: Clients may want to retrieve the flowlist.
HttpResponseStatus(context, HTTP_BAD_REQUEST); * Still stupid, but eh. */
*response = MatrixErrorCreate(M_BAD_JSON, msg); HttpResponseStatus(context, HTTP_UNAUTHORIZED);
ret = 0; ret = BuildResponse(flows, db, response, session, dbRef);
goto finish; goto finish;
} }