mirror of
https://github.com/projectdysnomia/dysnomia.git
synced 2026-12-02 13:48:31 +02:00
This commit switches Dysnomia over to ESLint flat config for futureproofing and better maintainability. For the most part, the codebase will pass the test suite, apart from a few exceptions introduced by the stylistic plugin which I believe are reasonable to include. Additionally, JSDoc linting was added to maintain proper alignment of various features.
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
"use strict";
|
|
|
|
const ThreadChannel = require("./ThreadChannel");
|
|
|
|
/**
|
|
* Represents a private thread channel. See ThreadChannel for extra properties.
|
|
* @extends ThreadChannel
|
|
*/
|
|
class PrivateThreadChannel extends ThreadChannel {
|
|
constructor(data, client, messageLimit) {
|
|
super(data, client, messageLimit);
|
|
}
|
|
|
|
update(data, client) {
|
|
super.update(data, client);
|
|
if(data.thread_metadata !== undefined) {
|
|
/**
|
|
* Metadata for the thread
|
|
* @override
|
|
* @type {ThreadChannel.ThreadMetadata}
|
|
*/
|
|
this.threadMetadata = {
|
|
archiveTimestamp: Date.parse(data.thread_metadata.archive_timestamp),
|
|
archived: data.thread_metadata.archived,
|
|
autoArchiveDuration: data.thread_metadata.auto_archive_duration,
|
|
createTimestamp: !data.thread_metadata.create_timestamp ? null : Date.parse(data.thread_metadata.create_timestamp),
|
|
invitable: data.thread_metadata.invitable,
|
|
locked: data.thread_metadata.locked
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = PrivateThreadChannel;
|