Skip to content

Commit

Permalink
Fix colibri2 error response handling (jitsi-xmpp-extensions, jicoco). (
Browse files Browse the repository at this point in the history
…jitsi#924)

* chore: Update jitsi-xmpp-extensions.
* ref: Adapt to jicoco changes.
* chore: Update jicoco.
  • Loading branch information
bgrozev authored May 31, 2022
1 parent 21e7584 commit 64f79fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<slf4j.version>1.7.32</slf4j.version>
<jersey.version>3.0.4</jersey.version>
<jitsi.utils.version>1.0-115-gb93957d</jitsi.utils.version>
<jicoco.version>1.1-107-gfb316f8</jicoco.version>
<jicoco.version>1.1-109-gd47a5e0</jicoco.version>
<spotbugs.version>4.6.0</spotbugs.version>
<junit.version>5.8.2</junit.version>
</properties>
Expand Down Expand Up @@ -131,7 +131,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jitsi-xmpp-extensions</artifactId>
<version>1.0-45-g209f259</version>
<version>1.0-53-g0113a6b</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
12 changes: 5 additions & 7 deletions src/test/kotlin/org/jitsi/jicofo/mock/MockColibri2Server.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.jitsi.xmpp.extensions.colibri2.Transport
import org.jitsi.xmpp.extensions.jingle.DtlsFingerprintPacketExtension
import org.jitsi.xmpp.extensions.jingle.IceUdpTransportPacketExtension
import org.jitsi.xmpp.extensions.jingle.ParameterPacketExtension
import org.jitsi.xmpp.util.IQUtils
import org.jitsi.xmpp.util.createError
import org.jivesoftware.smack.packet.IQ
import org.jivesoftware.smack.packet.StanzaError
import org.jivesoftware.smack.packet.StanzaError.Condition.bad_request
Expand All @@ -50,23 +50,21 @@ class MockColibri2Server {
fun handleConferenceModifyIq(request: ConferenceModifyIQ): IQ {
val conference: Conference = if (request.create) {
if (conferences.containsKey(request.meetingId)) {
return IQUtils.createError(request, conflict, "Conference already exists")
return createError(request, conflict, "Conference already exists")
}
val newConference = Conference(request.meetingId)
conferences[request.meetingId] = newConference
newConference
} else {
conferences[request.meetingId]
?: return IQUtils.createError(request, item_not_found, "Conference not found")
?: return createError(request, item_not_found, "Conference not found")
}

return try {
conference.handleRequest(request)
} catch (e: IqProcessingException) {
return IQUtils.createError(request, e.condition, e.message).apply {
// Make sure to tag the error as coming from a bridge, otherwise item_not_found may be misiterpreted.
addExtension(Colibri2Error())
}
// Make sure to tag the error as coming from a bridge, otherwise item_not_found may be misiterpreted.
return createError(request, e.condition, e.message, Colibri2Error())
}
}
private fun expireConference(meetingId: String) = conferences.remove(meetingId)
Expand Down

0 comments on commit 64f79fc

Please sign in to comment.