Added chat timestamps, started work on nameplate settings

This commit is contained in:
rainbow napkin 2026-10-14 03:13:38 -04:00
parent 8b7faf6354
commit 282d4133e8
5 changed files with 38 additions and 5 deletions

View file

@ -26,8 +26,9 @@ class chatMetadata{
* @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.
* @param {Number} timestamp - UTC Epoch from when message was sent
*/
constructor(user, flair, highLevel, msg, type, links){
constructor(user, flair, highLevel, msg, type, links, timestamp = new Date.now()){
/**
* Name of user who sent the message
*/
@ -57,6 +58,11 @@ class chatMetadata{
* Array of URLs/Links included in the message.
*/
this.links = links;
/**
* Datetime message was sent
*/
this.timestamp = timestamp;
}
}

View file

@ -51,6 +51,10 @@ const chatSchema = new mongoose.Schema({
type: [linkSchema],
required: true,
},
timestamp: {
type: mongoose.SchemaTypes.Number,
default: Date.now()
}
});
module.exports = chatSchema;

View file

@ -46,6 +46,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
<select>
</select>
</span>
<span id="settings-panel-nameplate-format" class="settings-panel-setting">
<p>Chat nameplate: </p>
<select>
<option value="left">Left</option>
<option value="top">Top</option>
<option value="timestamp">Top w/ timestamp</option>
</select>
</span>
<span id="settings-panel-min-chat-width" class="settings-panel-setting">
<p>Aspect Ratio Lock Limiter: </p>
<input type="number">