Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make room name comparison case agnostic #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ChefdeCambuse
Copy link

When providing the room name as shown by Jitsi - e.g. "DarkSignsMobilizeExpectantly" - gst-meet will connect to the room but never proceed as the response(s) to send_presence contain the room name in lower case.

@linkmauve
Copy link
Contributor

linkmauve commented Jan 22, 2023

This isn’t the only transformation Jitsi Meet does, it converts PascalCase titles to kebab-case localparts.

Additionally, localparts comparisons after stringprep are case insensitive so your operation is a noop.

@jbg
Copy link
Contributor

jbg commented May 13, 2023

it converts PascalCase titles to kebab-case localparts

In what situation does it do that? I haven't seen it do that.

Anyway, there is indeed a problem here, because we compare as a string, so the room name comparison fails if gst-meet is given a non-lowercase room name. I'm inclined to fold to lowercase when first configuring the room, though, rather than in this specific test. Alternatively, and probably preferably, we could ensure the use of jid types everywhere and avoid string comparison.

@linkmauve
Copy link
Contributor

Hi, since !200 and !204 there is now a NodePart type which has always had nodeprep applied, and is thus normalized. We haven’t released yet, but this issue will be fixed by using it everywhere. As a bonus, there won’t be any stringprep being done again when creating the BareJid of the room from it, only a string concatenation as we know it’s normalized already.

linkmauve added a commit to linkmauve/gst-meet that referenced this pull request Oct 18, 2023
The main change is that jid now stores the JID as a single string, with
an offset to the '@' and to the '/', and stringprep is now always
applied.  This lowers the size of the struct in memory, and makes it
much faster to display a JID.  In order to also make it fast to run
stringprep, there are new NodePart, DomainPart and ResourcePart types
which are guaranteed to have been validated/normalized, and thus can be
used to construct a JID at the cost of a format!() call.

In lib-gst-meet in particular, this removes quite a bunch of clone()
calls, but nothing significant.

Supersedes avstack#47.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants