damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

Post.swift (598B)


      1 //
      2 //  Post.swift
      3 //  damus
      4 //
      5 //  Created by William Casarin on 2022-05-07.
      6 //
      7 
      8 import Foundation
      9 
     10 struct NostrPost {
     11     let kind: NostrKind
     12     let content: String
     13     let references: [RefId]
     14     let tags: [[String]]
     15 
     16     init(content: String, references: [RefId], kind: NostrKind = .text, tags: [[String]] = []) {
     17         self.content = content
     18         self.references = references
     19         self.kind = kind
     20         self.tags = tags
     21     }
     22 }
     23 
     24 
     25 /// Return a list of tags
     26 func parse_post_blocks(content: String) -> [Block] {
     27     return parse_note_content(content: .content(content, nil)).blocks
     28 }
     29