Files
damus/damus/Nostr/Profiles.swift
William Casarin 8785f31834 NIP05 Verification
Changelog-Added: Added NIP05 Verification
2023-01-04 01:30:37 -08:00

32 lines
614 B
Swift

//
// Profiles.swift
// damus
//
// Created by William Casarin on 2022-04-17.
//
import Foundation
import UIKit
class Profiles {
var profiles: [String: TimestampedProfile] = [:]
var validated: [String: NIP05] = [:]
func is_validated(_ pk: String) -> NIP05? {
return validated[pk]
}
func add(id: String, profile: TimestampedProfile) {
profiles[id] = profile
}
func lookup(id: String) -> Profile? {
return profiles[id]?.profile
}
func lookup_with_timestamp(id: String) -> TimestampedProfile? {
return profiles[id]
}
}