Skip to content

Commit

Permalink
Include kind 6: reposts
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Oct 24, 2024
1 parent e4cd7df commit 59f27e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class NotificationsService : Service() {
TypedFilter(
types = COMMON_FEED_TYPES,
filter = SincePerRelayFilter(
kinds = listOf(1, 4, 13, 9735),
kinds = listOf(1, 4, 6, 7, 13, 9735),
tags = mapOf("p" to listOf(hexKey)),
since = RelayPool.getAll().associate { it.url to EOSETime(latestNotification) },
),
Expand Down Expand Up @@ -338,13 +338,22 @@ class NotificationsService : Service() {
title = if (event.content().contains("nostr:$pubKey")) {
getString(R.string.new_mention)
} else if (event.content().contains("nostr:nevent1")) {
getString(R.string.new_repost)
getString(R.string.new_quote)
} else {
getString(R.string.new_reply)
}
text = event.content().replace(Regex("nostr:[a-zA-Z0-9]+"), "")
} else if (event.kind == 6) {
title = getString(R.string.new_repost)
} else if (event.kind == 4 || event.kind == 13) {
title = getString(R.string.new_private)
} else if (event.kind == 7) {
title = getString(R.string.new_reaction)
text = if (event.content.isEmpty() || event.content == "+") {
"\uFE0F"
} else {
event.content
}
} else if (event.kind == 9735) {
title = getString(R.string.new_zap)
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<string name="new_mention">New mention</string>
<string name="new_reply">New reply</string>
<string name="new_repost">New repost</string>
<string name="new_quote">New quote</string>
<string name="new_private">New private message</string>
<string name="new_reaction">New reaction</string>
<string name="new_zap">New Zap</string>
<string name="new_follow">New Follow</string>
<string name="unknown">Unknown</string>
Expand Down

0 comments on commit 59f27e9

Please sign in to comment.