From 678795adcf4f3225108b70ff571258a4e0b6110b Mon Sep 17 00:00:00 2001 From: jack Date: Tue, 26 Aug 2025 21:13:40 +0200 Subject: [PATCH] fix(nostr): mark NostrInboxService @MainActor and use NostrEvent type; resolve Swift 6 actor isolation errors --- bitchat/Services/NostrInboxService.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bitchat/Services/NostrInboxService.swift b/bitchat/Services/NostrInboxService.swift index 96505531..0fcdb7f3 100644 --- a/bitchat/Services/NostrInboxService.swift +++ b/bitchat/Services/NostrInboxService.swift @@ -9,6 +9,7 @@ import Foundation +@MainActor final class NostrInboxService { private var processedIDs: Set = [] private var order: [String] = [] @@ -47,7 +48,7 @@ final class NostrInboxService { limit: Int, relayCount: Int, subID: String? = nil, - handler: @escaping (NostrProtocol.Event) -> Void + handler: @escaping (NostrEvent) -> Void ) -> String { let id = subID ?? "geo-\(geohash)" let filter = NostrFilter.geohashEphemeral( @@ -71,7 +72,7 @@ final class NostrInboxService { pubkeyHex: String, lookbackSeconds: TimeInterval, subID: String? = nil, - handler: @escaping (NostrProtocol.Event) -> Void + handler: @escaping (NostrEvent) -> Void ) -> String { let id = subID ?? "dm-\(pubkeyHex.prefix(8))" let filter = NostrFilter.giftWrapsFor(pubkey: pubkeyHex, since: Date().addingTimeInterval(-lookbackSeconds)) @@ -87,4 +88,3 @@ final class NostrInboxService { NostrRelayManager.shared.unsubscribe(id: id) } } -