Add filter helper to FilterState

Will be used in upcoming commits
This commit is contained in:
William Casarin
2023-01-02 12:40:49 -08:00
parent ed36a8c062
commit e3732b3adc

View File

@@ -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 {