Fix a few more hitches
This commit is contained in:
@@ -651,10 +651,12 @@ func print_filters(relay_id: String?, filters groups: [[NostrFilter]]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func process_metadata_event(our_pubkey: String, profiles: Profiles, ev: NostrEvent) {
|
func process_metadata_event(our_pubkey: String, profiles: Profiles, ev: NostrEvent) {
|
||||||
|
DispatchQueue.global(qos: .background).async {
|
||||||
guard let profile: Profile = decode_data(Data(ev.content.utf8)) else {
|
guard let profile: Profile = decode_data(Data(ev.content.utf8)) else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DispatchQueue.main.async {
|
||||||
if our_pubkey == ev.pubkey && (profile.deleted ?? false) {
|
if our_pubkey == ev.pubkey && (profile.deleted ?? false) {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
notify(.deleted_account, ())
|
notify(.deleted_account, ())
|
||||||
@@ -705,6 +707,9 @@ func process_metadata_event(our_pubkey: String, profiles: Profiles, ev: NostrEve
|
|||||||
}
|
}
|
||||||
|
|
||||||
notify(.profile_updated, ProfileUpdate(pubkey: ev.pubkey, profile: profile))
|
notify(.profile_updated, ProfileUpdate(pubkey: ev.pubkey, profile: profile))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func robohash(_ pk: String) -> String {
|
func robohash(_ pk: String) -> String {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Has
|
|||||||
}
|
}
|
||||||
|
|
||||||
var too_big: Bool {
|
var too_big: Bool {
|
||||||
return self.content.count > 16000
|
return self.content.underestimatedCount > 16000
|
||||||
}
|
}
|
||||||
|
|
||||||
var should_show_event: Bool {
|
var should_show_event: Bool {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ final class RelayConnection: WebSocketDelegate {
|
|||||||
self.isConnected = false
|
self.isConnected = false
|
||||||
|
|
||||||
case .text(let txt):
|
case .text(let txt):
|
||||||
if txt.count > 2000 {
|
if txt.underestimatedCount > 2000 {
|
||||||
DispatchQueue.global(qos: .default).async {
|
DispatchQueue.global(qos: .default).async {
|
||||||
if let ev = decode_nostr_event(txt: txt) {
|
if let ev = decode_nostr_event(txt: txt) {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
|||||||
Reference in New Issue
Block a user