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:
jack
2025-08-12 09:41:12 +02:00
parent 7a7c89e689
commit 99c0f6523e
6 changed files with 43 additions and 258 deletions
+1 -6
View File
@@ -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