validation: actually validate events
Check to see if id and/or signature are good Changelog-Changed: Check note ids and signatures on every note Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -140,6 +140,7 @@ struct EventView: View {
|
||||
.padding([.leading], 2)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.background(event_validity_color(event.validity))
|
||||
.id(event.id)
|
||||
.frame(minHeight: PFP_SIZE)
|
||||
.padding([.bottom], 4)
|
||||
@@ -147,6 +148,19 @@ struct EventView: View {
|
||||
}
|
||||
}
|
||||
|
||||
func event_validity_color(_ validation: ValidationResult) -> some View {
|
||||
Group {
|
||||
switch validation {
|
||||
case .ok:
|
||||
EmptyView()
|
||||
case .bad_id:
|
||||
Color.orange.opacity(0.4)
|
||||
case .bad_sig:
|
||||
Color.red.opacity(0.4)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
func pubkey_context_menu(bech32_pubkey: String) -> some View {
|
||||
return self.contextMenu {
|
||||
|
||||
Reference in New Issue
Block a user