Skip to content

Commit eb53e19

Browse files
authored
ref: Move hasTranscriber out of the detector. (#1173)
1 parent f0a8cc4 commit eb53e19

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

jicofo/src/main/kotlin/org/jitsi/jicofo/jigasi/JigasiDetector.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import org.jitsi.jicofo.JicofoConfig
2121
import org.jitsi.jicofo.metrics.JicofoMetricsContainer
2222
import org.jitsi.jicofo.xmpp.BaseBrewery
2323
import org.jitsi.jicofo.xmpp.XmppProvider
24-
import org.jitsi.jicofo.xmpp.muc.ChatRoom
2524
import org.jitsi.utils.OrderedJsonObject
2625
import org.jitsi.utils.logging2.createLogger
2726
import org.jitsi.xmpp.extensions.colibri.ColibriStatsExtension
@@ -98,11 +97,6 @@ open class JigasiDetector(
9897
transcriberCount.set(getInstanceCount { it.supportsTranscription() }.toLong())
9998
}
10099

101-
fun hasTranscriber(chatRoom: ChatRoom?): Boolean {
102-
return chatRoom?.members?.any { member -> member.isTranscriber }
103-
?: false
104-
}
105-
106100
/**
107101
* The companion object is necessary for the implicit call to this.createLogger() in the super constructor!
108102
*/

jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/JigasiIqHandler.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class JigasiIqHandler(
116116
exclude: List<Jid> = emptyList()
117117
) {
118118
val selector = if (request.iq.destination == "jitsi_meet_transcribe") {
119-
if (jigasiDetector.hasTranscriber(conference.chatRoom)) {
119+
if (conference.hasTranscriber()) {
120120
logger.warn("Request failed, transcriber already available: ${request.iq.toStringOpt()}")
121121
IQ.createErrorResponse(
122122
request.iq,
@@ -256,3 +256,5 @@ class JigasiIqHandler(
256256
}
257257
}
258258
}
259+
260+
private fun JitsiMeetConference.hasTranscriber(): Boolean = this.chatRoom?.members?.any { it.isTranscriber } ?: false

0 commit comments

Comments
 (0)