Revert "Move the Block helper type to its own file"

This fixes the broken tests

This reverts commit 286ae68fd6.
This commit is contained in:
William Casarin
2023-08-25 19:03:19 -07:00
parent 7255481705
commit f30f93f65c
9 changed files with 230 additions and 245 deletions

View File

@@ -130,9 +130,7 @@ struct DMChatView: View, KeyboardReadable {
func send_message() {
let tags = [["p", pubkey.hex()]]
let post_blocks = parse_post_blocks(content: dms.draft)
let content = post_blocks
.map(\.asString)
.joined(separator: "")
let content = render_blocks(blocks: post_blocks)
guard let dm = create_dm(content, to_pk: pubkey, tags: tags, keypair: damus_state.keypair) else {
print("error creating dm")

View File

@@ -445,15 +445,7 @@ func render_blocks(blocks bs: Blocks, profiles: Profiles) -> NoteArtifactsSepara
let blocks = bs.blocks
let one_note_ref = blocks
.filter({
if case .mention(let mention) = $0,
case .note = mention.ref {
return true
}
else {
return false
}
})
.filter({ $0.is_note_mention })
.count == 1
var ind: Int = -1