contacts: get followed hashtags function
todo: cache these
This commit is contained in:
@@ -69,7 +69,16 @@ class Contacts {
|
|||||||
func get_friend_list() -> [String] {
|
func get_friend_list() -> [String] {
|
||||||
return Array(friends)
|
return Array(friends)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func get_followed_hashtags() -> Set<String> {
|
||||||
|
guard let ev = self.event else { return Set() }
|
||||||
|
return ev.tags.reduce(into: Set<String>(), { htags, tag in
|
||||||
|
if tag.count >= 2 && tag[0] == "t" && tag[1] != "" {
|
||||||
|
htags.insert(tag[1])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func add_friend_pubkey(_ pubkey: String) {
|
func add_friend_pubkey(_ pubkey: String) {
|
||||||
friends.insert(pubkey)
|
friends.insert(pubkey)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user