fix(macos): validate remote ports

This commit is contained in:
Peter Steinberger
2026-01-07 11:00:21 +00:00
parent a5b29623b8
commit 85e536f3ff
8 changed files with 193 additions and 45 deletions

View File

@@ -0,0 +1,27 @@
import Foundation
enum GatewayAgentChannel: String, CaseIterable, Sendable {
case last
case webchat
case whatsapp
case telegram
init(raw: String?) {
let trimmed = raw?
.trimmingCharacters(in: .whitespacesAndNewlines)
.lowercased() ?? ""
self = GatewayAgentChannel(rawValue: trimmed) ?? .last
}
func shouldDeliver(_ isLast: Bool) -> Bool {
switch self {
case .webchat:
return false
case .last:
return isLast
case .whatsapp, .telegram:
return true
}
}
}