damus

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

commit e3732b3adc8a68f6ed126470c0349b558b1d89d9
parent ed36a8c062be8f7e32514bebc97a60ce26e01215
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  2 Jan 2023 12:40:49 -0800

Add filter helper to FilterState

Will be used in upcoming commits

Diffstat:
Mdamus/ContentView.swift | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -44,6 +44,15 @@ enum ThreadState { enum FilterState : Int { case posts_and_replies = 1 case posts = 0 + + func filter(privkey: String?, ev: NostrEvent) -> Bool { + switch self { + case .posts: + return !ev.is_reply(privkey) + case .posts_and_replies: + return true + } + } } struct ContentView: View {