diff --git a/webapp/titanembeds/static/css/embedstyle.css b/webapp/titanembeds/static/css/embedstyle.css index 5b94ca8..766089c 100644 --- a/webapp/titanembeds/static/css/embedstyle.css +++ b/webapp/titanembeds/static/css/embedstyle.css @@ -584,6 +584,11 @@ p.mentioned span.chatmessage { width: 100%; } +#chatcontent img.attachment { + width: 100%; + max-width: 300px; +} + #emoji-picker { color: black; position: fixed; diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index c8d30e6..2d0dffc 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -736,7 +736,11 @@ if (message.content.length != 0) { attach = " "; } - attach += message.attachments[i].url; + if (message.attachments[i].url.endsWith(".png") || message.attachments[i].url.endsWith(".jpg") || message.attachments[i].url.endsWith(".jpeg") || message.attachments[i].url.endsWith(".gif")) { + attach += ""; + } else { + attach += message.attachments[i].url; + } message.content += attach; } return message; @@ -900,10 +904,10 @@ message = replace_message_mentions(message); message = format_bot_message(message); message = parse_message_time(message); - message = parse_message_attachments(message); message.content = message.content.replaceAll("\\<", "<"); message.content = message.content.replaceAll("\\>", ">"); message.content = escapeHtml(message.content); + message = parse_message_attachments(message); message.content = parse_message_markdown(message.content); message = parse_channels_in_message(message); message = parse_emoji_in_message(message);