PeerID 14/n: Transport and its dependents (#753)

* Rearrange `Transport`’s properties and functions

* `NostrTransport`: group Transport-related code together

* `BLEService`: group Transport-related code together

* Extract `NotificationStreamAssembler` into a file

* Move private functions to a dedicated extension

* PeerID 14/n: `Transport` and its dependents
This commit is contained in:
Islam
2025-10-06 11:02:20 +02:00
committed by GitHub
parent 2673d28686
commit f86ae5e2ea
13 changed files with 2253 additions and 2218 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ final class GossipSyncManager {
var gcsTargetFpr: Double = 0.01 // 1%
}
private let myPeerID: String
private let myPeerID: PeerID
private let config: Config
weak var delegate: Delegate?
@@ -27,7 +27,7 @@ final class GossipSyncManager {
private var periodicTimer: DispatchSourceTimer?
private let queue = DispatchQueue(label: "mesh.sync", qos: .utility)
init(myPeerID: String, config: Config = Config()) {
init(myPeerID: PeerID, config: Config = Config()) {
self.myPeerID = myPeerID
self.config = config
}
@@ -90,7 +90,7 @@ final class GossipSyncManager {
let payload = buildGcsPayload()
let pkt = BitchatPacket(
type: MessageType.requestSync.rawValue,
senderID: Data(hexString: myPeerID) ?? Data(),
senderID: Data(hexString: myPeerID.id) ?? Data(),
recipientID: nil, // broadcast
timestamp: UInt64(Date().timeIntervalSince1970 * 1000),
payload: payload,
@@ -112,7 +112,7 @@ final class GossipSyncManager {
}
let pkt = BitchatPacket(
type: MessageType.requestSync.rawValue,
senderID: Data(hexString: myPeerID) ?? Data(),
senderID: Data(hexString: myPeerID.id) ?? Data(),
recipientID: recipient,
timestamp: UInt64(Date().timeIntervalSince1970 * 1000),
payload: payload,