From 64f79fc421908fe64c83c95d788a98a1afb6e2c2 Mon Sep 17 00:00:00 2001 From: bgrozev Date: Tue, 31 May 2022 15:03:39 -0500 Subject: [PATCH] Fix colibri2 error response handling (jitsi-xmpp-extensions, jicoco). (#924) * chore: Update jitsi-xmpp-extensions. * ref: Adapt to jicoco changes. * chore: Update jicoco. --- pom.xml | 4 ++-- .../org/jitsi/jicofo/mock/MockColibri2Server.kt | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 670c226a6d..24a6ca0faf 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 1.7.32 3.0.4 1.0-115-gb93957d - 1.1-107-gfb316f8 + 1.1-109-gd47a5e0 4.6.0 5.8.2 @@ -131,7 +131,7 @@ ${project.groupId} jitsi-xmpp-extensions - 1.0-45-g209f259 + 1.0-53-g0113a6b org.slf4j diff --git a/src/test/kotlin/org/jitsi/jicofo/mock/MockColibri2Server.kt b/src/test/kotlin/org/jitsi/jicofo/mock/MockColibri2Server.kt index 2693f1a069..d2e4614327 100644 --- a/src/test/kotlin/org/jitsi/jicofo/mock/MockColibri2Server.kt +++ b/src/test/kotlin/org/jitsi/jicofo/mock/MockColibri2Server.kt @@ -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 @@ -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)