From 5e7ef527d8ee453d3feb07160a61b1b07056e43c Mon Sep 17 00:00:00 2001 From: boks1971 Date: Mon, 14 Oct 2024 16:12:43 +0530 Subject: [PATCH] utility to for connection quality higher --- 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 +}