damus

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

FollowTarget.swift (412B)


      1 //
      2 //  FollowNotify.swift
      3 //  damus
      4 //
      5 //  Created by William Casarin on 2022-05-24.
      6 //
      7 
      8 import Foundation
      9 
     10 enum FollowTarget {
     11     case pubkey(Pubkey)
     12     case contact(NostrEvent)
     13 
     14     var follow_ref: FollowRef {
     15         FollowRef.pubkey(pubkey)
     16     }
     17 
     18     var pubkey: Pubkey {
     19         switch self {
     20         case .pubkey(let pk):   return pk
     21         case .contact(let ev):  return ev.pubkey
     22         }
     23     }
     24 }
     25 
     26