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

JID struct #99

Open
mmcco opened this issue Sep 20, 2015 · 2 comments
Open

JID struct #99

mmcco opened this issue Sep 20, 2015 · 2 comments

Comments

@mmcco
Copy link

mmcco commented Sep 20, 2015

JIDs are currently stored throughout the program as raw strings. If they were stored in a struct like this:

type JID struct {
    Node string
    Domain string
    Resource string
}

it would be much easier to extract and use the JID's fields. More importantly, it would better enforce JID validity checking, which doesn't seem to happen now. For example, the XMPP Core RFC specifies that:

Each allowable portion of a JID (node identifier, domain identifier,
and resource identifier) MUST NOT be more than 1023 bytes in length,
resulting in a maximum total size (including the '@' and '/'
separators) of 3071 bytes.

If you're interested, I can give it a shot and submit a pull request.

@aerth
Copy link

aerth commented Jan 7, 2016

would this also enable using just the Name string for same-server messages instead of using full JID all the time? like.. "bob sends message to alice" instead of "bob@example.com sends to alice@example.com" if on the same domain!

@mmcco
Copy link
Author

mmcco commented Jan 8, 2016

Honestly, that doesn't sounds like a great idea to me due to handle collisions and the existence of the Real Name field.

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

No branches or pull requests

2 participants