use url safe jingle session ids

Movim does not like slashes (/) in jingle session ids.
When proposing a session called 'wBKabx1kRIfkgNxAShip/w' Movim will
accept (proceed) a session called 'wBKabx1kRIfkgNxAShip' which the initiator of course does not know about. (Conversations will get stuck at ringing/discovering devices)

This is likely because a click on 'Reply' (accept call) in Movim opens upa pop up window where both the full jid as well as the session id are transmitted as part of the URL.

(Full jids can contain more than on slash btw)
This commit is contained in:
Daniel Gultsch 2023-10-04 13:30:39 +02:00
parent 1b5d2151d0
commit a8241c72df
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -73,7 +73,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
static String nextRandomId() {
final byte[] id = new byte[16];
new SecureRandom().nextBytes(id);
return Base64.encodeToString(id, Base64.NO_WRAP | Base64.NO_PADDING);
return Base64.encodeToString(id, Base64.NO_WRAP | Base64.NO_PADDING | Base64.URL_SAFE);
}
public void deliverPacket(final Account account, final JinglePacket packet) {