Fix Signal compose live updates and self-chat direction

This commit is contained in:
2026-02-22 11:03:08 +00:00
parent 65cd647f01
commit 0f36b2dde7
4 changed files with 124 additions and 13 deletions

View File

@@ -2047,8 +2047,13 @@
const appendBubble = function (msg) {
const messageId = String(msg && msg.id ? msg.id : "").trim();
if (messageId && panelState.seenMessageIds.has(messageId)) {
return;
if (messageId) {
const existingRow = Array.from(thread.querySelectorAll(".compose-row")).find(function (row) {
return String((row.dataset && row.dataset.messageId) || "") === messageId;
});
if (existingRow) {
existingRow.remove();
}
}
const row = document.createElement("div");
const outgoing = !!msg.outgoing;
@@ -2114,6 +2119,22 @@
fallback.textContent = "(no text)";
bubble.appendChild(fallback);
}
if (Array.isArray(msg.reactions) && msg.reactions.length) {
const reactionsWrap = document.createElement("div");
reactionsWrap.className = "compose-reactions";
reactionsWrap.setAttribute("aria-label", "Message reactions");
msg.reactions.forEach(function (reaction) {
const chip = document.createElement("span");
chip.className = "compose-reaction-chip";
chip.textContent = String(reaction && reaction.emoji ? reaction.emoji : "");
chip.title =
String((reaction && reaction.actor) || "Unknown")
+ " via "
+ String((reaction && reaction.source_service) || "unknown").toUpperCase();
reactionsWrap.appendChild(chip);
});
bubble.appendChild(reactionsWrap);
}
const meta = document.createElement("p");
meta.className = "compose-msg-meta";