diff --git a/ios/Shared/Models/MessageType.swift b/ios/Shared/Models/MessageType.swift index 8e250330a..75c1b4613 100644 --- a/ios/Shared/Models/MessageType.swift +++ b/ios/Shared/Models/MessageType.swift @@ -10,4 +10,14 @@ import Foundation enum MessageType: String, Codable { case e2e + case unknown + + public init(from decoder: Decoder) throws { + guard let rawValue = try? decoder.singleValueContainer().decode(String.self) else { + self = .unknown + return + } + + self = MessageType(rawValue: rawValue) ?? .unknown + } }