message recipient bugfix
This commit is contained in:
parent
c7ccad3974
commit
053818231a
6
index.js
6
index.js
@ -1,6 +1,6 @@
|
|||||||
// Global logging toggles
|
// Global logging toggles
|
||||||
// const fileLogging = false;
|
// const fileLogging = false;
|
||||||
const consoleLogging = false;
|
const consoleLogging = true;
|
||||||
|
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
@ -87,7 +87,7 @@ app.post('/nickname', (req, res) => {
|
|||||||
for (const u of users)
|
for (const u of users)
|
||||||
if (u.name === oldName && u.id === id) {
|
if (u.name === oldName && u.id === id) {
|
||||||
if (consoleLogging)
|
if (consoleLogging)
|
||||||
console.log(`(Re-)named user with ID '${oldName}#${id}'.`);
|
console.log(`Renamed user with ID '${oldName}#${id}'.`);
|
||||||
u.name = name;
|
u.name = name;
|
||||||
u.id = currentID;
|
u.id = currentID;
|
||||||
break;
|
break;
|
||||||
@ -140,7 +140,7 @@ app.post('/message', (req, res) => {
|
|||||||
|
|
||||||
// Log message for debugging
|
// Log message for debugging
|
||||||
if (consoleLogging)
|
if (consoleLogging)
|
||||||
console.log(`User '${name}#${id}' sent message '${message}'.`);
|
console.log(`User '${name}#${id}' sent message '${message}' to '${recipient}'.`);
|
||||||
|
|
||||||
// Confirm process
|
// Confirm process
|
||||||
res.status(200).send();
|
res.status(200).send();
|
||||||
|
Loading…
Reference in New Issue
Block a user