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<
string,
{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;
token!: string;
userinfo!: Specialuser;

View file

@ -455,15 +455,19 @@ class Message extends SnowFlake {
}
if (this.message_reference) {
const replyline = document.createElement("div");
const minipfp = document.createElement("img");
minipfp.classList.add("replypfp");
replyline.appendChild(minipfp);
const username = document.createElement("span");
replyline.appendChild(username);
const reply = document.createElement("div");
username.classList.add("username");
reply.classList.add("replytext", "ellipsis");
replyline.appendChild(reply);
const line2 = document.createElement("hr");
replyline.appendChild(line2);
line2.classList.add("reply");
@ -480,6 +484,11 @@ class Message extends SnowFlake {
username.textContent = "Blocked user";
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;
reply.appendChild(message.content.makeHTML({stdsize: true}));
minipfp.src = author.getpfpsrc();

View file

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