Files
damus/damus/Nostr/NostrKind.swift
ericholguin 6376c61bad Highlights
This patch adds highlights (NIP-84) to Damus.

Kind 9802 are handled by all the necessary models.
We show highlighted events, longform events, and url references.
Url references also leverage text fragments to take the user to the highlighted text.

Testing
——
iPhone 15 Pro Max (17.0) Dark Mode:
https://v.nostr.build/oM6DW.mp4

iPhone 15 Pro Max (17.0) Light Mode:
https://v.nostr.build/BRrmP.mp4

iPhone SE (3rd generation) (16.4) Light Mode:
https://v.nostr.build/6GzKa.mp4
——

Closes: https://github.com/damus-io/damus/issues/2172
Closes: https://github.com/damus-io/damus/issues/1772
Closes: https://github.com/damus-io/damus/issues/1773
Closes: https://github.com/damus-io/damus/issues/2173
Closes: https://github.com/damus-io/damus/issues/2175
Changelog-Added: Highlights (NIP-84)

PATCH CHANGELOG:
V1 -> V2: addressed review comments highlights are now truncated and highlight label shown in Thread view
V2 -> V3: handle case where highlight context is smaller than the highlight content

Signed-off-by: ericholguin <ericholguin@apache.org>
2024-06-21 12:00:44 -07:00

31 lines
566 B
Swift

//
// NostrKind.swift
// damus
//
// Created by William Casarin on 2022-04-27.
//
import Foundation
enum NostrKind: UInt32, Codable {
case metadata = 0
case text = 1
case contacts = 3
case dm = 4
case delete = 5
case boost = 6
case like = 7
case chat = 42
case mute_list = 10000
case list_deprecated = 30000
case longform = 30023
case zap = 9735
case zap_request = 9734
case highlight = 9802
case nwc_request = 23194
case nwc_response = 23195
case http_auth = 27235
case status = 30315
}