Refactor: BitchatMessage (#610)

* Extract BitchatMessage into a separate file

* Convert `fromBinaryPayload` to `convenience init?`

* Extract message dedup into an extension

* Remove dead `formatMessageContent`

* Minor refactor of timestamp and username formatting

* Remove dead `getSenderColor`
This commit is contained in:
Islam
2025-09-15 15:00:12 +02:00
committed by GitHub
parent 347ce5ece4
commit ea8d51a36b
11 changed files with 392 additions and 449 deletions
+1 -1
View File
@@ -215,7 +215,7 @@ final class BLEServiceTests: XCTestCase {
let expectation = XCTestExpectation(description: "Delivery handler called")
service.packetDeliveryHandler = { packet in
if let msg = BitchatMessage.fromBinaryPayload(packet.payload) {
if let msg = BitchatMessage(packet.payload) {
XCTAssertEqual(msg.content, "Test delivery")
expectation.fulfill()
}