ndb: sync up a few remaining NdbNote tag differences

This commit is contained in:
William Casarin
2023-07-25 16:22:25 -07:00
parent 2f8aa29e92
commit 593d0e2abe
14 changed files with 93 additions and 60 deletions

View File

@@ -35,13 +35,12 @@ class ProfileModel: ObservableObject, Equatable {
}
for tag in contacts.tags {
guard tag.count >= 2 && tag[0].matches_char("p") else {
guard tag.count >= 2,
tag[0].matches_char("p"),
tag[1].matches_str(pubkey)
else {
continue
}
if tag[1] == pubkey {
return true
}
}
return false
@@ -145,10 +144,10 @@ class ProfileModel: ObservableObject, Equatable {
}
func count_pubkeys(_ tags: [[String]]) -> Int {
func count_pubkeys(_ tags: Tags) -> Int {
var c: Int = 0
for tag in tags {
if tag.count >= 2 && tag[0] == "p" {
if tag.count >= 2 && tag[0].matches_char("p") {
c += 1
}
}