mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-06-10 04:12:10 +03:00
Fix not detecting .jpeg files as images
This commit is contained in:
parent
fe065a50d8
commit
c05f90c31e
@ -17,6 +17,12 @@ var DISCORD = (function(){
|
|||||||
mentionChannel: /<#(\d+?)>/g
|
mentionChannel: /<#(\d+?)>/g
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var isImageAttachment = function(attachment){
|
||||||
|
var dot = attachment.url.lastIndexOf(".");
|
||||||
|
var ext = dot === -1 ? "" : attachment.url.substring(dot).toLowerCase();
|
||||||
|
return ext === ".png" || ext === ".gif" || ext === ".jpg" || ext === ".jpeg";
|
||||||
|
};
|
||||||
|
|
||||||
var templateChannelServer;
|
var templateChannelServer;
|
||||||
var templateChannelPrivate;
|
var templateChannelPrivate;
|
||||||
var templateMessage;
|
var templateMessage;
|
||||||
@ -138,9 +144,7 @@ var DISCORD = (function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
return value.map(attachment => {
|
return value.map(attachment => {
|
||||||
var ext = attachment.url.slice(-4).toLowerCase();
|
if (isImageAttachment(attachment) && STATE.settings.enableImagePreviews){
|
||||||
|
|
||||||
if ((ext === ".png" || ext === ".gif" || ext === ".jpg" || ext === ".jpeg") && STATE.settings.enableImagePreviews){
|
|
||||||
return templateEmbedImage.apply(attachment);
|
return templateEmbedImage.apply(attachment);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user