diff --git a/bitchat/Utils/InputValidator.swift b/bitchat/Utils/InputValidator.swift index 3b00e9ad..82597242 100644 --- a/bitchat/Utils/InputValidator.swift +++ b/bitchat/Utils/InputValidator.swift @@ -81,17 +81,8 @@ struct InputValidator { // MARK: - Protocol Field Validation - /// Validates message type is within valid range - static func validateMessageType(_ type: UInt8) -> Bool { - // Check against known message types - let validTypes: Set = [ - 0x01, 0x03, 0x04, 0x05, 0x06, 0x07, 0x0A, 0x0B, 0x0C, - 0x10, 0x11, 0x12, 0x13, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, - 0x30, 0x31 - ] - return validTypes.contains(type) - } + // Note: Message type validation is performed closer to decoding using + // MessageType/NoisePayloadType enums; keeping validator free of stale lists. /// Validates hop count is reasonable static func validateHopCount(_ hopCount: UInt8) -> Bool { @@ -139,4 +130,4 @@ private extension Character { var isHexDigit: Bool { return "0123456789abcdefABCDEF".contains(self) } -} \ No newline at end of file +}