message recipient bugfix

This commit is contained in:
Baipyrus 2023-01-21 22:13:29 +01:00
parent c7ccad3974
commit 053818231a

View File

@ -1,6 +1,6 @@
// Global logging toggles
// const fileLogging = false;
const consoleLogging = false;
const consoleLogging = true;
// Imports
@ -87,7 +87,7 @@ app.post('/nickname', (req, res) => {
for (const u of users)
if (u.name === oldName && u.id === id) {
if (consoleLogging)
console.log(`(Re-)named user with ID '${oldName}#${id}'.`);
console.log(`Renamed user with ID '${oldName}#${id}'.`);
u.name = name;
u.id = currentID;
break;
@ -140,7 +140,7 @@ app.post('/message', (req, res) => {
// Log message for debugging
if (consoleLogging)
console.log(`User '${name}#${id}' sent message '${message}'.`);
console.log(`User '${name}#${id}' sent message '${message}' to '${recipient}'.`);
// Confirm process
res.status(200).send();