attachment reply fix

This commit is contained in:
MathMan05 2025-01-15 15:39:47 -06:00
parent adddd366f2
commit ec08cdfde0
3 changed files with 17 additions and 2 deletions

View file

@ -36,7 +36,12 @@ class Localuser {
badges = new Map< badges = new Map<
string, string,
{id: string; description: string; icon: string; link?: string; translate?: boolean} {id: string; description: string; icon: string; link?: string; translate?: boolean}
>(badgeArr); >(
badgeArr as [
string,
{id: string; description: string; icon: string; link?: string; translate?: boolean},
][],
);
lastSequence: number | null = null; lastSequence: number | null = null;
token!: string; token!: string;
userinfo!: Specialuser; userinfo!: Specialuser;

View file

@ -455,15 +455,19 @@ class Message extends SnowFlake {
} }
if (this.message_reference) { if (this.message_reference) {
const replyline = document.createElement("div"); const replyline = document.createElement("div");
const minipfp = document.createElement("img"); const minipfp = document.createElement("img");
minipfp.classList.add("replypfp"); minipfp.classList.add("replypfp");
replyline.appendChild(minipfp); replyline.appendChild(minipfp);
const username = document.createElement("span"); const username = document.createElement("span");
replyline.appendChild(username); replyline.appendChild(username);
const reply = document.createElement("div"); const reply = document.createElement("div");
username.classList.add("username"); username.classList.add("username");
reply.classList.add("replytext", "ellipsis"); reply.classList.add("replytext", "ellipsis");
replyline.appendChild(reply); replyline.appendChild(reply);
const line2 = document.createElement("hr"); const line2 = document.createElement("hr");
replyline.appendChild(line2); replyline.appendChild(line2);
line2.classList.add("reply"); line2.classList.add("reply");
@ -480,6 +484,11 @@ class Message extends SnowFlake {
username.textContent = "Blocked user"; username.textContent = "Blocked user";
return; return;
} }
if (message.attachments.length || message.embeds.length) {
const b = document.createElement("b");
b.innerText = I18n.getTranslation("message.attached");
reply.append(b);
}
const author = message.author; const author = message.author;
reply.appendChild(message.content.makeHTML({stdsize: true})); reply.appendChild(message.content.makeHTML({stdsize: true}));
minipfp.src = author.getpfpsrc(); minipfp.src = author.getpfpsrc();

View file

@ -321,7 +321,8 @@
"delete": "Delete message", "delete": "Delete message",
"edit": "Edit message", "edit": "Edit message",
"edited": "(edited)", "edited": "(edited)",
"deleted": "Deleted message" "deleted": "Deleted message",
"attached": "Sent an attachment"
}, },
"instanceStats": { "instanceStats": {
"name": "Instance stats: $1", "name": "Instance stats: $1",