damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

PersistedProfile.swift (1240B)


      1 //
      2 //  PersistedProfile.swift
      3 //  damus
      4 //
      5 //  Created by Bryan Montz on 4/30/23.
      6 //
      7 
      8 import Foundation
      9 import CoreData
     10 
     11 @objc(PersistedProfile)
     12 final class PersistedProfile: NSManagedObject {
     13     @NSManaged var id: String?
     14     @NSManaged var name: String?
     15     @NSManaged var display_name: String?
     16     @NSManaged var about: String?
     17     @NSManaged var picture: String?
     18     @NSManaged var banner: String?
     19     @NSManaged var website: String?
     20     @NSManaged var lud06: String?
     21     @NSManaged var lud16: String?
     22     @NSManaged var nip05: String?
     23     @NSManaged var damus_donation: Int16
     24     @NSManaged var last_update: Date?       // The date that the profile was last updated by the user
     25     @NSManaged var network_pull_date: Date? // The date we got this profile from a relay (for staleness checking)
     26     
     27     func copyValues(from profile: Profile) {
     28         name = profile.name
     29         display_name = profile.display_name
     30         about = profile.about
     31         picture = profile.picture
     32         banner = profile.banner
     33         website = profile.website
     34         lud06 = profile.lud06
     35         lud16 = profile.lud16
     36         nip05 = profile.nip05
     37         damus_donation = profile.damus_donation != nil ? Int16(profile.damus_donation!) : 0
     38     }
     39 }