refactor(Message): remove stored edit history (#5155)

This commit is contained in:
Matt (IPv4) Cowley
2020-12-30 10:21:34 +00:00
committed by GitHub
parent 6a77453532
commit 8c2e6b70b8
4 changed files with 0 additions and 39 deletions

View File

@@ -185,13 +185,6 @@ class Message extends Base {
}
: null;
/**
* The previous versions of the message, sorted with the most recent first
* @type {Message[]}
* @private
*/
this._edits = [];
if (this.member && data.member) {
this.member._patch(data.member);
} else if (data.member && this.guild && this.author) {
@@ -246,11 +239,6 @@ class Message extends Base {
*/
patch(data) {
const clone = this._clone();
const { messageEditHistoryMaxSize } = this.client.options;
if (messageEditHistoryMaxSize !== 0) {
const editsLimit = messageEditHistoryMaxSize === -1 ? Infinity : messageEditHistoryMaxSize;
if (this._edits.unshift(clone) > editsLimit) this._edits.pop();
}
if ('edited_timestamp' in data) this.editedTimestamp = new Date(data.edited_timestamp).getTime();
if ('content' in data) this.content = data.content;
@@ -383,18 +371,6 @@ class Message extends Base {
});
}
/**
* An array of cached versions of the message, including the current version
* Sorted from latest (first) to oldest (last)
* @type {Message[]}
* @readonly
*/
get edits() {
const copy = this._edits.slice();
copy.unshift(this);
return copy;
}
/**
* Whether the message is editable by the client user
* @type {boolean}