Update ForceImagePreviews.plugin.js

This commit is contained in:
Mirco Wittrien 2020-03-16 11:01:36 +01:00
parent ade4a48090
commit 5432250105
1 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,7 @@ var ForceImagePreviews = (_ => {
return class ForceImagePreviews {
getName () {return "ForceImagePreviews";}
getVersion () {return "1.1.6";}
getVersion () {return "1.1.7";}
getAuthor () {return "DevilBro";}
@ -12,8 +12,7 @@ var ForceImagePreviews = (_ => {
constructor () {
this.changelog = {
"fixed":[["Message Update","Fixed the plugin for the new Message Update"]],
"improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]]
"fixed":[["Imgur","No longer double emebds imgur images"]]
};
this.patchedModules = {
@ -53,6 +52,7 @@ var ForceImagePreviews = (_ => {
BDFDB.PluginUtils.init(this);
BDFDB.ModuleUtils.forceAllUpdates(this);
BDFDB.MessageUtils.rerenderAll();
}
else console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not load BD functions!");
}
@ -62,6 +62,7 @@ var ForceImagePreviews = (_ => {
this.stopping = true;
BDFDB.ModuleUtils.forceAllUpdates(this);
BDFDB.MessageUtils.rerenderAll();
BDFDB.PluginUtils.clear(this);
}
@ -141,7 +142,7 @@ var ForceImagePreviews = (_ => {
}
isEmbedded (embeds, link) {
for (let embed of embeds) if (embed.url == link) return true;
for (let embed of embeds) if (embed.url == link || embed.image && embed.image.url == link) return true;
return false;
}
}