~samwhited/xmpp

5e924e64afc710e06d42d61eb32a4a4781947ae7 — Sam Whited 5 years ago 075b015
Don't enforce localpart if it doesn't exist
1 files changed, 5 insertions(+), 3 deletions(-)

M jid/jid.go
M jid/jid.go => jid/jid.go +5 -3
@@ 75,9 75,11 @@ func New(localpart, domainpart, resourcepart string) (*JID, error) {
	// TODO: I have no idea what this is talking about… what rules? RFC 5892 is a
	//       bunch of property lists. Maybe it meant RFC 5895?

	localpart, err = precis.UsernameCaseMapped.String(localpart)
	if err != nil {
		return nil, err
	if localpart != "" {
		localpart, err = precis.UsernameCaseMapped.String(localpart)
		if err != nil {
			return nil, err
		}
	}

	if resourcepart != "" {