Damus Live

This PR adds Live Streaming and Live Chat to Damus via Damus Labs.

Changelog-Added: Added live stream timeline
Changelog-Added: Added live chat timeline
Changelog-Added: Added ability to create live chat event
Changelog-Added: Damus Labs Toggle

Signed-off-by: ericholguin <ericholguin@apache.org>
This commit is contained in:
ericholguin
2025-11-06 17:36:04 -07:00
committed by Daniel D’Aquino
parent a31f6bce0e
commit b8c664d354
39 changed files with 1793 additions and 92 deletions

View File

@@ -512,6 +512,15 @@ func make_like_event(keypair: FullKeypair, liked: NostrEvent, content: String =
return NostrEvent(content: content, keypair: keypair.to_keypair(), kind: 7, tags: tags)
}
func make_live_chat_event(keypair: FullKeypair, content: String, root: String, dtag: String, relayURL: RelayURL?) -> NostrEvent? {
//var tags = Array(boosted.referenced_pubkeys).map({ pk in pk.tag })
var aTagBuilder = ["a", "30311:\(root):\(dtag)"]
var tags: [[String]] = [aTagBuilder]
return NostrEvent(content: content, keypair: keypair.to_keypair(), kind: 1311, tags: tags)
}
func generate_private_keypair(our_privkey: Privkey, id: NoteId, created_at: UInt32) -> FullKeypair? {
let to_hash = our_privkey.hex() + id.hex() + String(created_at)
guard let dat = to_hash.data(using: .utf8) else {

View File

@@ -18,6 +18,7 @@ enum NostrKind: UInt32, Codable {
case boost = 6
case like = 7
case chat = 42
case live_chat = 1311
case mute_list = 10000
case relay_list = 10002
case interest_list = 10015
@@ -30,6 +31,7 @@ enum NostrKind: UInt32, Codable {
case nwc_request = 23194
case nwc_response = 23195
case http_auth = 27235
case live = 30311
case status = 30315
case contact_card = 30_382
case follow_list = 39089