Skip to content

Commit

Permalink
fis: Fixes encoding room parameter used in bosh url.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Jan 29, 2024
1 parent de5e08f commit cff7434
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/main/java/org/jitsi/jigasi/JvbConference.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.java.sip.communicator.util.DataObject;
import net.java.sip.communicator.util.osgi.ServiceUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.*;
import org.jitsi.impl.neomedia.*;
import org.jitsi.jigasi.lobby.Lobby;
import org.jitsi.jigasi.stats.*;
Expand Down Expand Up @@ -58,8 +59,8 @@

import java.beans.*;
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.concurrent.*;

import static net.java.sip.communicator.service.protocol.event.LocalUserChatRoomPresenceChangeEvent.*;
import static org.jivesoftware.smack.packet.StanzaError.Condition.*;
Expand Down Expand Up @@ -170,7 +171,7 @@ public class JvbConference

return true;
}
catch (Exception e)
catch (Throwable e)
{
logger.error("Error processing xmpp queue item", e);

Expand Down Expand Up @@ -1690,8 +1691,19 @@ else if ("org.jitsi.jigasi.xmpp.acc.USER_ID".equals(overridenProp)
String boshUrl = ctx.getBoshURL();
if (StringUtils.isNotEmpty(boshUrl))
{
boshUrl = boshUrl.replace(
"{roomName}", callContext.getConferenceName());
boshUrl = boshUrl.replace("{roomName}", callContext.getConferenceName());

try
{
// Make sure we encode the roomName parameter
URIBuilder encodedUrlBuilder = new URIBuilder(boshUrl);
encodedUrlBuilder.setParameter("room", callContext.getConferenceName());
boshUrl = encodedUrlBuilder.build().toURL().toString();
}
catch (URISyntaxException | MalformedURLException e)
{
logger.error(ctx + " Cannot encode bosh url param room", e);
}

logger.info(ctx + " Using bosh url:" + boshUrl);
properties.put(JabberAccountID.BOSH_URL, boshUrl);
Expand Down

0 comments on commit cff7434

Please sign in to comment.