Skip to content

Commit

Permalink
ref: Remove unused transcription code.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev committed Sep 5, 2024
1 parent b2bffe6 commit c9cf2c1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ interface ChatRoom {
* Read from the MUC config form. */
val participantsSoftLimit: Int?

/** Whether the room is configured to require transcription. */
val transcriptionRequested: Boolean

val debugState: OrderedJsonObject

/** Returns the number of members that currently have their audio sources unmuted. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ class ChatRoomImpl(
}
}

override var transcriptionRequested: Boolean = false
private set(value) {
if (value != field) {
logger.info("transcriptionRequested is now $value.")
field = value
eventEmitter.fireEvent { transcriptionRequestedChanged(value) }
}
}

private val avModerationByMediaType = ConcurrentHashMap<MediaType, AvModerationForMediaType>()

/** The emitter used to fire events. */
Expand Down Expand Up @@ -297,7 +288,6 @@ class ChatRoomImpl(
}

override fun setRoomMetadata(roomMetadata: RoomMetadata) {
transcriptionRequested = roomMetadata.metadata?.recording?.isTranscribingEnabled == true
visitorsLive = roomMetadata.metadata?.visitors?.live == true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ interface ChatRoomListener {
fun localRoleChanged(newRole: MemberRole) {}
fun numAudioSendersChanged(numAudioSenders: Int) {}
fun numVideoSendersChanged(numVideoSenders: Int) {}
fun transcriptionRequestedChanged(transcriptionRequested: Boolean) {}
}

/** A class with the default kotlin method implementations (to avoid using @JvmDefault) **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ data class RoomMetadata(
val metadata: Metadata?
) {
@JsonIgnoreProperties(ignoreUnknown = true)
data class Metadata(val recording: Recording?, val visitors: Visitors?) {
@JsonIgnoreProperties(ignoreUnknown = true)
data class Recording(val isTranscribingEnabled: Boolean?)

data class Metadata(val visitors: Visitors?) {
@JsonIgnoreProperties(ignoreUnknown = true)
data class Visitors(val live: Boolean?)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@ package org.jitsi.jicofo.xmpp.muc

import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.ShouldSpec
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldBeInstanceOf

class RoomMetadataTest : ShouldSpec() {
init {
context("Valid") {
context("With isTranscribingEnabled set") {
context("With visitors.live set") {
val parsed = RoomMetadata.parse(
"""
{
"type": "room_metadata",
"metadata": {
"recording": {
"isTranscribingEnabled": true,
"visitors": {
"live": true,
"anotherField": 123
},
"anotherField": {}
Expand All @@ -42,9 +41,9 @@ class RoomMetadataTest : ShouldSpec() {
""".trimIndent()
)
parsed.shouldBeInstanceOf<RoomMetadata>()
parsed.metadata!!.recording!!.isTranscribingEnabled shouldBe true
parsed.metadata!!.visitors!!.live shouldBe true
}
context("With no recording included") {
context("With no visitors included") {

val parsed = RoomMetadata.parse(
"""
Expand All @@ -60,8 +59,7 @@ class RoomMetadataTest : ShouldSpec() {
""".trimIndent()
)
parsed.shouldBeInstanceOf<RoomMetadata>()
parsed.metadata.shouldNotBeNull()
parsed.metadata?.recording shouldBe null
parsed.metadata!!.visitors shouldBe null
}
}
context("Invalid") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2402,11 +2402,6 @@ public void memberPresenceChanged(@NotNull ChatRoomMember member)
{
}

@Override
public void transcriptionRequestedChanged(boolean transcriptionRequested)
{
}

@Override
public void numAudioSendersChanged(int numAudioSenders)
{
Expand Down
13 changes: 1 addition & 12 deletions jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import org.jitsi.xmpp.extensions.jitsimeet.MuteIqProvider
import org.jitsi.xmpp.extensions.jitsimeet.MuteVideoIqProvider
import org.jitsi.xmpp.extensions.jitsimeet.StartMutedProvider
import org.jitsi.xmpp.extensions.jitsimeet.StatsId
import org.jitsi.xmpp.extensions.jitsimeet.TranscriptionRequestExtension
import org.jitsi.xmpp.extensions.jitsimeet.TranscriptionStatusExtension
import org.jitsi.xmpp.extensions.jitsimeet.UserInfoPacketExt
import org.jitsi.xmpp.extensions.jitsimeet.VideoMutedExtension
Expand Down Expand Up @@ -109,12 +108,7 @@ fun registerXmppExtensions() {
DefaultPacketExtensionProvider(JitsiParticipantCodecList::class.java)
)

// Add the extensions used for handling the inviting of transcriber
ProviderManager.addExtensionProvider(
TranscriptionRequestExtension.ELEMENT,
TranscriptionRequestExtension.NAMESPACE,
DefaultPacketExtensionProvider(TranscriptionRequestExtension::class.java)
)
// The extension used for detecting a transcriber
ProviderManager.addExtensionProvider(
TranscriptionStatusExtension.ELEMENT,
TranscriptionStatusExtension.NAMESPACE,
Expand Down Expand Up @@ -146,11 +140,6 @@ fun registerXmppExtensions() {
MuteIqProvider.registerMuteIqProvider()
MuteVideoIqProvider.registerMuteVideoIqProvider()
StartMutedProvider.registerStartMutedProvider()
ProviderManager.addExtensionProvider(
TranscriptionStatusExtension.ELEMENT,
TranscriptionStatusExtension.NAMESPACE,
DefaultPacketExtensionProvider(TranscriptionStatusExtension::class.java)
)

ProviderManager.addExtensionProvider(
AudioMutedExtension.ELEMENT,
Expand Down

0 comments on commit c9cf2c1

Please sign in to comment.