fix: add renames

This commit is contained in:
LordMZTE 2023-03-13 23:28:36 +01:00
parent afda305c27
commit d54c3149d3
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
1 changed files with 4 additions and 1 deletions

View File

@ -157,18 +157,21 @@ fn runServer() !void {
defer alloc.free(req.str);
if (mappings.get(req.str)) |mapping| {
const res = StringPacket{ .str = mapping.mapped };
const renamed = renames.get(mapping.mapped);
const res = StringPacket{ .str = renamed orelse mapping.mapped };
try res.write(con.stream.writer());
std.log.info(
\\
\\ Unmapped: {s}
\\ Mapped: {s}
\\ Renamed: {s}
\\
\\ Doc: {s}
, .{
req.str,
mapping.mapped,
renamed orelse "<no rename>",
mapping.doc orelse "<no docs>",
});
} else {