mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
feat(notifications): push-notify Buzz-style bare reactions/reposts to your note
A Buzz like is a bare ["e", <id>] reaction with no p tag, so the push gate's (isTaggedUser || publicChatReply) pre-clause rejected it even though tagsAnEventByUser already recognizes a reaction/repost whose reacted note is mine. Relax the pre-clause for reaction/repost kinds; tagsAnEventByUser keeps it scoped to reactions on my own note. Reuses the existing Reaction/Repost renderers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122uQ8BLHLeHDni81RBP26r
This commit is contained in:
+8
@@ -216,6 +216,13 @@ class NotificationDispatcher(
|
||||
// tagsAnEventByUser's replyTo check would otherwise
|
||||
// always miss for replies into addressable posts.
|
||||
val note = LocalCache.getNoteIfExists(event) ?: return@predicate false
|
||||
// Reactions/reposts are routed by tagsAnEventByUser
|
||||
// (the reacted note's author == me), not by a `p`
|
||||
// tag — so a Buzz-style bare `["e", id]` like, which
|
||||
// carries no `p` tag, still notifies. tagsAnEventByUser
|
||||
// below keeps it scoped to reactions on MY note.
|
||||
val isReactionOrRepost =
|
||||
event is ReactionEvent || event is RepostEvent || event is GenericRepostEvent
|
||||
pubkeys.any { pubkey ->
|
||||
// Public chat replies into my own messages often
|
||||
// omit the `p` tag; relax the gate for them (the
|
||||
@@ -223,6 +230,7 @@ class NotificationDispatcher(
|
||||
// messages actually replying to me).
|
||||
(
|
||||
event.isTaggedUser(pubkey) ||
|
||||
isReactionOrRepost ||
|
||||
NotificationFeedFilter.isNotifiablePublicChatReply(note, pubkey)
|
||||
) &&
|
||||
NotificationFeedFilter.tagsAnEventByUser(note, pubkey)
|
||||
|
||||
Reference in New Issue
Block a user