mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-08-29 07:27:16 +00:00
fix(nostr): mark NostrInboxService @MainActor and use NostrEvent type; resolve Swift 6 actor isolation errors
This commit is contained in:
parent
37e973bf9f
commit
678795adcf
@ -9,6 +9,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
final class NostrInboxService {
|
||||
private var processedIDs: Set<String> = []
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user