mirror of
git://jb55.com/damus
synced 2024-09-18 19:23:49 +00:00
oops, add profiles
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
d950ad75b8
commit
b4660bd58f
26
damus/Nostr/Profiles.swift
Normal file
26
damus/Nostr/Profiles.swift
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// Profiles.swift
|
||||
// damus
|
||||
//
|
||||
// Created by William Casarin on 2022-04-17.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
class Profiles: ObservableObject {
|
||||
@Published var profiles: [String: TimestampedProfile] = [:]
|
||||
|
||||
func add(id: String, profile: TimestampedProfile) {
|
||||
profiles[id] = profile
|
||||
objectWillChange.send()
|
||||
}
|
||||
|
||||
func lookup(id: String) -> Profile? {
|
||||
return profiles[id]?.profile
|
||||
}
|
||||
|
||||
func lookup_with_timestamp(id: String) -> TimestampedProfile? {
|
||||
return profiles[id]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user