mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:25:20 +00:00
refactor: remove dead code and consolidate system messages
- Delete 3 unused functions in ShareViewController (36 lines) - Extract addSystemMessage() helper to eliminate duplication (120+ lines) - Remove 22 'let _ =' wasteful computations across multiple files - Net reduction of 215 lines of dead/duplicate code - Improves maintainability and reduces technical debt
This commit is contained in:
@@ -37,7 +37,6 @@ struct NostrProtocol {
|
||||
|
||||
// 2. Create ephemeral key for this message
|
||||
let ephemeralKey = try P256K.Schnorr.PrivateKey()
|
||||
let _ = Data(ephemeralKey.xonly.bytes).hexEncodedString()
|
||||
// Created ephemeral key for seal
|
||||
|
||||
// 3. Seal the rumor (encrypt to recipient)
|
||||
@@ -213,7 +212,6 @@ struct NostrProtocol {
|
||||
throw NostrError.invalidPublicKey
|
||||
}
|
||||
|
||||
let _ = Data(senderKey.xonly.bytes).hexEncodedString()
|
||||
// Encrypting message
|
||||
|
||||
// Derive shared secret
|
||||
@@ -447,14 +445,11 @@ struct NostrProtocol {
|
||||
|
||||
// Log with explicit UTC and local time for debugging
|
||||
let formatter = DateFormatter()
|
||||
// Removed unnecessary date formatting operations
|
||||
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
formatter.timeZone = TimeZone(abbreviation: "UTC")
|
||||
let _ = formatter.string(from: now)
|
||||
let _ = formatter.string(from: randomized)
|
||||
|
||||
formatter.timeZone = TimeZone.current
|
||||
let _ = formatter.string(from: now)
|
||||
let _ = formatter.string(from: randomized)
|
||||
|
||||
// Timestamp randomized for privacy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user