From b6e6f0f63bc1e98f2850ab2d1da2de358abd2a5b Mon Sep 17 00:00:00 2001 From: jack Date: Wed, 30 Jul 2025 23:22:02 +0200 Subject: [PATCH] Fix unused variable warnings in NostrProtocol.swift Replace unused variable names with _ to silence compiler warnings: - ephemeralPubkey calculation (line 40) - senderPubkey calculation (line 216) - timestamp formatter strings (lines 452-453, 456-457) --- bitchat/Nostr/NostrProtocol.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bitchat/Nostr/NostrProtocol.swift b/bitchat/Nostr/NostrProtocol.swift index bdf5dd1b..068ce648 100644 --- a/bitchat/Nostr/NostrProtocol.swift +++ b/bitchat/Nostr/NostrProtocol.swift @@ -37,7 +37,7 @@ struct NostrProtocol { // 2. Create ephemeral key for this message let ephemeralKey = try P256K.Schnorr.PrivateKey() - let ephemeralPubkey = Data(ephemeralKey.xonly.bytes).hexEncodedString() + let _ = Data(ephemeralKey.xonly.bytes).hexEncodedString() // Created ephemeral key for seal // 3. Seal the rumor (encrypt to recipient) @@ -213,7 +213,7 @@ struct NostrProtocol { throw NostrError.invalidPublicKey } - let senderPubkey = Data(senderKey.xonly.bytes).hexEncodedString() + let _ = Data(senderKey.xonly.bytes).hexEncodedString() // Encrypting message // Derive shared secret @@ -449,12 +449,12 @@ struct NostrProtocol { let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd HH:mm:ss" formatter.timeZone = TimeZone(abbreviation: "UTC") - let nowUTC = formatter.string(from: now) - let randomizedUTC = formatter.string(from: randomized) + let _ = formatter.string(from: now) + let _ = formatter.string(from: randomized) formatter.timeZone = TimeZone.current - let nowLocal = formatter.string(from: now) - let randomizedLocal = formatter.string(from: randomized) + let _ = formatter.string(from: now) + let _ = formatter.string(from: randomized) // Timestamp randomized for privacy