mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 00:52:36 +03:00
Added ability to set verified when instantiating Mention
refs https://github.com/TryGhost/Team/issues/2548 We need to be able to do this outside of the verify method so that repository implementations have the ability to create existing instances without running expensive verification checks!
This commit is contained in:
parent
101cabb188
commit
277a563138
@ -166,6 +166,7 @@ module.exports = class Mention {
|
||||
this.#timestamp = data.timestamp;
|
||||
this.#payload = data.payload;
|
||||
this.#resourceId = data.resourceId;
|
||||
this.#verified = data.verified;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -223,6 +224,10 @@ module.exports = class Mention {
|
||||
let payload;
|
||||
payload = data.payload ? JSON.parse(JSON.stringify(data.payload)) : null;
|
||||
|
||||
/** @type boolean */
|
||||
let verified;
|
||||
verified = isNew ? false : !!data.verified;
|
||||
|
||||
/** @type {ObjectID | null} */
|
||||
let resourceId = null;
|
||||
if (data.resourceId) {
|
||||
@ -239,7 +244,8 @@ module.exports = class Mention {
|
||||
target,
|
||||
timestamp,
|
||||
payload,
|
||||
resourceId
|
||||
resourceId,
|
||||
verified
|
||||
});
|
||||
|
||||
mention.setSourceMetadata(data);
|
||||
|
Loading…
Reference in New Issue
Block a user