Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip attachments with missing thumbnails #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions chattr.html
Original file line number Diff line number Diff line change
Expand Up @@ -900,13 +900,14 @@ <h3 style="margin:1em;font-weight:bold">Contact List</h3>
var attachmentRoot = "attachments.noindex/";
if (media) {
var thumb = media["thumbnail"];
var thumbPath = attachmentRoot + thumb["path"];
var thumbWidth = thumb["width"] + "px";
var thumbHeight = thumb["height"] + "px";

if(thumb) {
var thumbPath = attachmentRoot + thumb["path"];
var thumbWidth = thumb["width"] + "px";
var thumbHeight = thumb["height"] + "px";
}
/* If attachments are used as the root message of a quote, it won't
* have a base path itself, only a thumbnail. */
if (media["path"]) {
if (thumb && media["path"]) {
var mediaId = media["path"].split("/")[1];
var mediaPath = attachmentRoot + media["path"];
var mediaWidth = media["width"];
Expand All @@ -928,7 +929,7 @@ <h3 style="margin:1em;font-weight:bold">Contact List</h3>
content += "<a href='#" + mediaId + "' rel='modal:open'><img src='" +
thumbPath +
"' style='width:" + thumbWidth + ";height:" + thumbHeight + "'></a>";
} else {
} else if(thumb) {
content = "<img src='" +
thumbPath +
"' style='width:" + thumbWidth + ";height:" + thumbHeight + "'>";
Expand Down