eleven / messenger Public

Revert "ios+mac: a trailing reaction stays silent in the sidebar" (#526)

This reverts commit da3c078bf5f5781f2447fb5b9585fdc9a5017a64.
James Adam b9891748661c29e4bba7e8f47ffa1ef7cca9c3c5 parent c20195e
2 files changed, +9 −21
  • ios/LChatCore/Sources/LChatCore/ThreadStore.swift +8 −15
  • ios/LChatMac/NativeChatView.swift +1 −6
diff --git a/ios/LChatCore/Sources/LChatCore/ThreadStore.swift b/ios/LChatCore/Sources/LChatCore/ThreadStore.swift
index 6316a12..3be63e4 100644
--- a/ios/LChatCore/Sources/LChatCore/ThreadStore.swift
+++ b/ios/LChatCore/Sources/LChatCore/ThreadStore.swift
@@ -199,21 +199,14 @@ public final class ThreadStore: ObservableObject {
var lastMine = false
if let lb = t.last_blob, !lb.isEmpty, let key,
let p = try? key.decryptJSON(MessagePayload.self, blob: lb) {
- if p.isReactionEvent {
- // A trailing reaction stays silent in the sidebar — no
- // preview (previewText would render a blank "Name: ") and
- // no unread dot, mirroring the web's load path (shell.js).
- lastMine = true
- } else {
- preview = previewText(kind: t.kind, payload: p)
- // A chat whose latest message is ours isn't unread — sending from
- // any device means we've read it. Old payloads have no uid; fall
- // back to the screen name (mirrors ownMessage in web/static/ui.js).
- if let uid = p.uid, !myUserId.isEmpty {
- lastMine = uid == myUserId
- } else if let n = p.name, !n.isEmpty {
- lastMine = n == rosterLabels[myUserId]
- }
+ preview = previewText(kind: t.kind, payload: p)
+ // A chat whose latest message is ours isn't unread — sending from
+ // any device means we've read it. Old payloads have no uid; fall
+ // back to the screen name (mirrors ownMessage in web/static/ui.js).
+ if let uid = p.uid, !myUserId.isEmpty {
+ lastMine = uid == myUserId
+ } else if let n = p.name, !n.isEmpty {
+ lastMine = n == rosterLabels[myUserId]
}
}
// An app thread with no activity yet shows its blurb instead of a
diff --git a/ios/LChatMac/NativeChatView.swift b/ios/LChatMac/NativeChatView.swift
index 3115966..4949fb3 100644
--- a/ios/LChatMac/NativeChatView.swift
+++ b/ios/LChatMac/NativeChatView.swift
@@ -1213,12 +1213,7 @@ struct NativeChatView: View {
content, senderName: name, senderUID: p.uid,
origin: origin, conversationID: tid,
groupName: thread.kind == "group" ? thread.title : nil,
- // The decorated banner names the sender itself, so reactions
- // take the un-attributed form (previewText would be blank —
- // a reaction payload has no text).
- messageText: p.isReactionEvent
- ? "Reacted \(p.emoji ?? "") to your message"
- : previewText(kind: "dm", payload: p)) {
+ messageText: previewText(kind: "dm", payload: p)) {
deliver = styled
}
UNUserNotificationCenter.current().add(