From db3ec58ad9fa3134ae414919bc4839fe3056912e Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Fri, 24 Oct 2025 00:26:29 -0400 Subject: [PATCH] Simplified chatMetadata based classes. --- src/app/channel/chat.js | 7 +------ src/app/chatMetadata.js | 8 +++++++- src/app/pm/message.js | 7 +------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/app/channel/chat.js b/src/app/channel/chat.js index c9c5853..eb09071 100644 --- a/src/app/channel/chat.js +++ b/src/app/channel/chat.js @@ -27,12 +27,7 @@ class chat extends chatMetadata{ */ constructor(user, flair, highLevel, msg, type, links){ //Call derived constructor - super(flair, highLevel, msg, type, links); - - /** - * User who sent the message - */ - this.user = user; + super(user, flair, highLevel, msg, type, links); } } diff --git a/src/app/chatMetadata.js b/src/app/chatMetadata.js index df5fbd6..23320ac 100644 --- a/src/app/chatMetadata.js +++ b/src/app/chatMetadata.js @@ -20,13 +20,19 @@ along with this program. If not, see .*/ class chatMetadata{ /** * Instantiates a chat metadata object + * @param {String} user - Name of user who sent the message * @param {String} flair - Flair ID String for the flair used to send the message * @param {Number} highLevel - Number representing current high level * @param {String} msg - Contents of the message, with links replaced with numbered file-seperator markers * @param {String} type - Message Type Identifier, used for client-side processing. * @param {Array} links - Array of URLs/Links included in the message. */ - constructor(flair, highLevel, msg, type, links){ + constructor(user, flair, highLevel, msg, type, links){ + /** + * Name of user who sent the message + */ + this.user = user; + /** * Flair ID String for the flair used to send the message */ diff --git a/src/app/pm/message.js b/src/app/pm/message.js index 28dc46f..a6604ff 100644 --- a/src/app/pm/message.js +++ b/src/app/pm/message.js @@ -27,12 +27,7 @@ class message extends chatMetadata{ */ constructor(user, recipients, flair, highLevel, msg, type, links){ //Call derived constructor - super(flair, highLevel, msg, type, links); - - /** - * Name of user who sent the message - */ - this.user = user; + super(user, flair, highLevel, msg, type, links); /** * Array of usernames who are supposed to receive the message