notifications: add support for tagged mentions

These are text notes that have you tagged but do not have inline
mentions or are replies.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin authored and Daniel D’Aquino committed 2024-09-05 20:02:07 -07:00
1 parent d9bbca1005
commit 1dbf7101b9
4 files changed
+43 -15

No files matched your search

+16 -1
View File
@@ -48,10 +48,24 @@ struct LossyLocalNotification {
}
}
enum NotificationTarget {
case note(NostrEvent)
case note_id(NoteId)
var id: NoteId {
switch self {
case .note(let note):
return note.id
case .note_id(let id):
return id
}
}
}
struct LocalNotification {
let type: LocalNotificationType
let event: NostrEvent
let target: NostrEvent
let target: NotificationTarget
let content: String
func to_lossy() -> LossyLocalNotification {
@@ -64,6 +78,7 @@ enum LocalNotificationType: String {
case like
case mention
case reply
case tagged
case repost
case zap
case profile_zap