From a3ae28b3c5e1e5c062821e361b941e35fee6cebd Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Mon, 14 Oct 2024 16:22:16 +0530 Subject: [PATCH] utility to for connection quality higher (#851) --- utils/connectionquality.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/connectionquality.go b/utils/connectionquality.go index 7187f1c0..54c2033f 100644 --- a/utils/connectionquality.go +++ b/utils/connectionquality.go @@ -30,3 +30,11 @@ func IsConnectionQualityLower(prev livekit.ConnectionQuality, curr livekit.Conne // WARNING NOTE: comparing protobuf enums directly return curr < prev } + +func IsConnectionQualityHigher(prev livekit.ConnectionQuality, curr livekit.ConnectionQuality) bool { + if IsConnectionQualityLower(prev, curr) { + return false + } + + return curr != prev +}