Simplified chatMetadata based classes.

This commit is contained in:
rainbow napkin 2025-10-24 00:26:29 -04:00
parent b8de76b448
commit db3ec58ad9
3 changed files with 9 additions and 13 deletions

View file

@ -27,12 +27,7 @@ class chat extends chatMetadata{
*/ */
constructor(user, flair, highLevel, msg, type, links){ constructor(user, flair, highLevel, msg, type, links){
//Call derived constructor //Call derived constructor
super(flair, highLevel, msg, type, links); super(user, flair, highLevel, msg, type, links);
/**
* User who sent the message
*/
this.user = user;
} }
} }

View file

@ -20,13 +20,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
class chatMetadata{ class chatMetadata{
/** /**
* Instantiates a chat metadata object * 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 {String} flair - Flair ID String for the flair used to send the message
* @param {Number} highLevel - Number representing current high level * @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} 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 {String} type - Message Type Identifier, used for client-side processing.
* @param {Array} links - Array of URLs/Links included in the message. * @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 * Flair ID String for the flair used to send the message
*/ */

View file

@ -27,12 +27,7 @@ class message extends chatMetadata{
*/ */
constructor(user, recipients, flair, highLevel, msg, type, links){ constructor(user, recipients, flair, highLevel, msg, type, links){
//Call derived constructor //Call derived constructor
super(flair, highLevel, msg, type, links); super(user, flair, highLevel, msg, type, links);
/**
* Name of user who sent the message
*/
this.user = user;
/** /**
* Array of usernames who are supposed to receive the message * Array of usernames who are supposed to receive the message