[FIX] Fix conflicts and make branch buildable.

This commit is contained in:
lda 2024-01-06 15:53:26 +01:00
parent 568543ab39
commit 5851298957
4 changed files with 9 additions and 7 deletions

View File

@ -1,5 +1,6 @@
/* /*
* Copyright (C) 2022-2023 Jordan Bancino <@jordan:bancino.net> * Copyright (C) 2022-2024 Jordan Bancino <@jordan:bancino.net> with
* other valuable contributors. See CONTRIBUTORS.txt for the full list.
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files * obtaining a copy of this software and associated documentation files

View File

@ -53,14 +53,14 @@ ROUTE_IMPL(RouteAliasDirectory, path, argp)
User *user = NULL; User *user = NULL;
CommonID aliasID; CommonID aliasID;
Config *config; Config config;
aliasID.sigil = '\0'; aliasID.sigil = '\0';
aliasID.local = NULL; aliasID.local = NULL;
aliasID.server.hostname = NULL; aliasID.server.hostname = NULL;
aliasID.server.port = NULL; aliasID.server.port = NULL;
config = ConfigLock(db); ConfigLock(db, &config);
if (!ParseCommonID(alias, &aliasID) || aliasID.sigil != '#') if (!ParseCommonID(alias, &aliasID) || aliasID.sigil != '#')
{ {
@ -121,7 +121,7 @@ ROUTE_IMPL(RouteAliasDirectory, path, argp)
char *serverPart; char *serverPart;
serverPart = ParserRecomposeServerPart(aliasID.server); serverPart = ParserRecomposeServerPart(aliasID.server);
if (!StrEquals(serverPart, config->serverName)) if (!StrEquals(serverPart, config.serverName))
{ {
msg = "Invalid server name."; msg = "Invalid server name.";
HttpResponseStatus(args->context, HTTP_BAD_REQUEST); HttpResponseStatus(args->context, HTTP_BAD_REQUEST);
@ -235,7 +235,7 @@ ROUTE_IMPL(RouteAliasDirectory, path, argp)
finish: finish:
CommonIDFree(aliasID); CommonIDFree(aliasID);
ConfigUnlock(config); ConfigUnlock(&config);
UserUnlock(user); UserUnlock(user);
DbUnlock(db, ref); DbUnlock(db, ref);
JsonFree(request); JsonFree(request);

View File

@ -366,7 +366,7 @@ UiaComplete(Array * flows, HttpServerContext * context, Db * db,
config.serverName); config.serverName);
if (!type || !StrEquals(type, "m.id.user") if (!type || !StrEquals(type, "m.id.user")
|| !userId || !userId
|| !ParserServerNameEquals(userId->server, config.serverName)) || !ParserServerNameEquals(userId->server, config.serverName))
{ {
HttpResponseStatus(context, HTTP_UNAUTHORIZED); HttpResponseStatus(context, HTTP_UNAUTHORIZED);

View File

@ -1,5 +1,6 @@
/* /*
* Copyright (C) 2022-2023 Jordan Bancino <@jordan:bancino.net> * Copyright (C) 2022-2024 Jordan Bancino <@jordan:bancino.net> with
* other valuable contributors. See CONTRIBUTORS.txt for the full list.
* *
* Permission is hereby granted, free of charge, to any person * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files * obtaining a copy of this software and associated documentation files