Node.js based forum software built for the modern web
test: fix spec
Barış Soner Uşaklı0e2a42d547ab
diff --git a/public/openapi/components/schemas/Chats.yaml b/public/openapi/components/schemas/Chats.yamlindex 036b937158..3d4339c083 100644--- a/public/openapi/components/schemas/Chats.yaml+++ b/public/openapi/components/schemas/Chats.yaml@@ -108,6 +108,10 @@ MessageObject:`icon:text` for the user'sauto-generated iconexample: "#f44336"+ banned_until:+ type: number+ description: A UNIX timestamp representing the moment a ban will be lifted+ example: 0banned_until_readable:type: stringdescription: An ISO 8601 formatted date string representing the moment a ban will be lifted, or the words "Not Banned"diff --git a/public/openapi/components/schemas/TopicObject.yaml b/public/openapi/components/schemas/TopicObject.yamlindex 64c47f0daa..605c32de85 100644--- a/public/openapi/components/schemas/TopicObject.yaml+++ b/public/openapi/components/schemas/TopicObject.yaml@@ -60,8 +60,6 @@ TopicObject:signature:type: stringnullable: true- banned:- type: numberstatus:type: stringicon:text:@@ -76,6 +74,10 @@ TopicObject:`icon:text` for the user's auto-generatediconexample: "#f44336"+ banned:+ type: number+ banned_until:+ type: numberbanned_until_readable:type: stringrequired:diff --git a/public/openapi/components/schemas/UserObject.yaml b/public/openapi/components/schemas/UserObject.yamlindex 5dc0da6bf4..61d98b1f80 100644--- a/public/openapi/components/schemas/UserObject.yaml+++ b/public/openapi/components/schemas/UserObject.yaml@@ -681,6 +681,10 @@ UserObjectACP:lastonlineISO:type: stringexample: '2020-03-27T20:30:36.590Z'+ banned_until:+ type: number+ description: A UNIX timestamp representing the moment a ban will be lifted+ example: 0banned_until_readable:type: stringdescription: An ISO 8601 formatted date string representing the moment a ban will be lifted, or the words "Not Banned"diff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yamlindex 77e9ec44f6..6ae0e8500e 100644--- a/public/openapi/read/unread.yaml+++ b/public/openapi/read/unread.yaml@@ -109,6 +109,8 @@ get:`icon:text` for the user's auto-generatediconexample: "#f44336"+ banned_until:+ type: numberbanned_until_readable:type: stringrequired:diff --git a/public/openapi/read/user/userslug/chats/roomid.yaml b/public/openapi/read/user/userslug/chats/roomid.yamlindex 73c4a62da9..448f350a42 100644--- a/public/openapi/read/user/userslug/chats/roomid.yaml+++ b/public/openapi/read/user/userslug/chats/roomid.yaml@@ -124,6 +124,8 @@ get:`icon:text` for the user's auto-generatediconexample: "#f44336"+ banned_until:+ type: numberbanned_until_readable:type: stringdeleted:diff --git a/public/openapi/write/categories/cid/moderator/uid.yaml b/public/openapi/write/categories/cid/moderator/uid.yamlindex 3e7223d1d7..bbba82c7c6 100644--- a/public/openapi/write/categories/cid/moderator/uid.yaml+++ b/public/openapi/write/categories/cid/moderator/uid.yaml@@ -79,6 +79,10 @@ put:type: numberdescription: A Boolean representing whether a user is banned or notexample: 0+ banned_until:+ type: number+ description: A UNIX timestamp representing the moment a ban will be lifted+ example: 0banned_until_readable:type: stringdescription: An ISO 8601 formatted date string representing the moment a ban will be lifted, or the words "Not Banned"diff --git a/src/user/data.js b/src/user/data.jsindex 80a9b5d9bf..d45e4a6259 100644--- a/src/user/data.js+++ b/src/user/data.js@@ -275,7 +275,7 @@ module.exports = function (User) {user.joindateISO = utils.toISOString(user.joindate);}- if (user.hasOwnProperty('lastonline')) {+ if (user.hasOwnProperty('lastonline') && (!requestedFields.length || requestedFields.includes('lastonline')) && !fieldsToRemove.includes('lastonline')) {user.lastonlineISO = utils.toISOString(user.lastonline) || user.joindateISO;}