Always check signatures on profile events

These contain sensitive data (lightning addresses) and it would be
really bad if these were forged.

Changelog-Changed: Always check signatures of profile events
This commit is contained in:
William Casarin
2023-04-15 16:01:00 -07:00
parent 668b0a94df
commit 02fc065005
10 changed files with 106 additions and 91 deletions

View File

@@ -15,6 +15,7 @@ class EventCache {
private var cancellable: AnyCancellable?
private var translations: [String: TranslateStatus] = [:]
private var artifacts: [String: NoteArtifacts] = [:]
var validation: [String: ValidationResult] = [:]
//private var thread_latest: [String: Int64]
@@ -26,6 +27,14 @@ class EventCache {
}
}
func is_event_valid(_ evid: String) -> ValidationResult {
guard let result = validation[evid] else {
return .unknown
}
return result
}
func store_translation_artifacts(evid: String, translated: TranslateStatus) {
self.translations[evid] = translated
}