Browse Source

allow extended embeds without image

Andrew Dolgov 3 months ago
parent
commit
029ed9932d
1 changed files with 5 additions and 3 deletions
  1. 5 3
      js/tt-irc.js

+ 5 - 3
js/tt-irc.js

@@ -258,18 +258,20 @@ const Message = function(data, chan) {
 					link.html(truncate_string(json.title, maxlen));
 				}
 
-				if (ALLOW_EMBEDS && allow_extended && json.image) {
+				if (ALLOW_EMBEDS && allow_extended && (json.image || json.descr)) {
 					const box = $("<div>")
 						.attr("class", "extended-link")
 						.attr("title", json.descr);
 
 					let real_src;
 
-					if (json.image.indexOf("data:") == 0)
+					if (json.image && json.image.indexOf("data:") == 0)
 						real_src = json.image;
-					else
+					else if (json.image)
 						real_src = "backend.php?op=imgproxy&resize="+IMAGE_THUMB+"&url=" +
 							param_escape(json.image);
+					else
+						real_src = ""; //"images/icon-app.png";
 
 					const thumb = $("<img>")
 						.attr("class", "img-embed")