mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 15:05:20 +00:00
Remove all channel functionality and clean up test suite
- Remove channel UI elements from ContentView - Remove channel data structures and methods from ChatViewModel - Remove channel commands (/j, /leave, /channels) - Remove channel field from BitchatMessage protocol - Remove channel message types and handling - Remove NoiseChannelEncryption.swift entirely - Clean up all channel references across the codebase - Fix compilation warnings (var to let conversions) - Remove all outdated test files that used incorrect APIs - Simplify app to only support public broadcast and 1:1 private messages
This commit is contained in:
@@ -95,62 +95,6 @@ class KeychainManager {
|
||||
#endif
|
||||
}
|
||||
|
||||
// MARK: - Channel Passwords
|
||||
|
||||
func saveChannelPassword(_ password: String, for channel: String) -> Bool {
|
||||
let key = "channel_\(channel)"
|
||||
let result = save(password, forKey: key)
|
||||
SecureLogger.logKeyOperation("save", keyType: "channel password for \(channel)", success: result)
|
||||
return result
|
||||
}
|
||||
|
||||
func getChannelPassword(for channel: String) -> String? {
|
||||
let key = "channel_\(channel)"
|
||||
return retrieve(forKey: key)
|
||||
}
|
||||
|
||||
func deleteChannelPassword(for channel: String) -> Bool {
|
||||
let key = "channel_\(channel)"
|
||||
let result = delete(forKey: key)
|
||||
SecureLogger.logKeyOperation("delete", keyType: "channel password for \(channel)", success: result)
|
||||
return result
|
||||
}
|
||||
|
||||
func getAllChannelPasswords() -> [String: String] {
|
||||
var passwords: [String: String] = [:]
|
||||
|
||||
// Build query without kSecReturnData to avoid error -50
|
||||
var query: [String: Any] = [
|
||||
kSecClass as String: kSecClassGenericPassword,
|
||||
kSecAttrService as String: service,
|
||||
kSecMatchLimit as String: kSecMatchLimitAll,
|
||||
kSecReturnAttributes as String: true
|
||||
]
|
||||
|
||||
// For sandboxed apps, use the app group
|
||||
if isSandboxed() {
|
||||
query[kSecAttrAccessGroup as String] = appGroup
|
||||
}
|
||||
|
||||
var result: AnyObject?
|
||||
let status = SecItemCopyMatching(query as CFDictionary, &result)
|
||||
|
||||
if status == errSecSuccess, let items = result as? [[String: Any]] {
|
||||
for item in items {
|
||||
if let account = item[kSecAttrAccount as String] as? String,
|
||||
account.hasPrefix("channel_") {
|
||||
// Now retrieve the actual password data for this specific item
|
||||
let channel = String(account.dropFirst(8)) // Remove "channel_" prefix
|
||||
if let password = getChannelPassword(for: channel) {
|
||||
passwords[channel] = password
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return passwords
|
||||
}
|
||||
|
||||
// MARK: - Identity Keys
|
||||
|
||||
func saveIdentityKey(_ keyData: Data, forKey key: String) -> Bool {
|
||||
@@ -290,7 +234,7 @@ class KeychainManager {
|
||||
|
||||
// Delete ALL keychain data for panic mode
|
||||
func deleteAllKeychainData() -> Bool {
|
||||
SecureLogger.logSecurityEvent(.invalidKey(reason: "Panic mode - deleting all keychain data"), level: .warning)
|
||||
SecureLogger.log("Panic mode - deleting all keychain data", category: SecureLogger.security, level: .warning)
|
||||
|
||||
var totalDeleted = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user