hack for dropbox

This commit is contained in:
Anthony Minessale 2014-07-25 02:03:08 +05:00
parent 6f800ef90a
commit e09ea08c34

View File

@ -115,7 +115,11 @@ var callbacks = {
var body = data.body;
if (body.match(/\.gif|\.jpg|\.jpeg|\.png/)) {
body = body.replace(/(http[s]{0,1}:\/\/\S+)/g, "<a target='_blank' href='$1'>$1<br><img border='0' class='chatimg' src='$1?dl=1'><\/a>");
var mod = "";
if (body.match(/dropbox.com/)) {
mod = "?dl=1";
}
body = body.replace(/(http[s]{0,1}:\/\/\S+)/g, "<a target='_blank' href='$1'>$1<br><img border='0' class='chatimg' src='$1'" + mod + "><\/a>");
} else {
body = body.replace(/(http[s]{0,1}:\/\/\S+)/g, "<a target='_blank' href='$1'>$1<\/a>");
}