MUC Invitation from parsing

Hi, I am using Smack (4.2.0 beta3) to develop an Android client. On some servers I can send/receive MUC invitations without issue. However on other servers, the client receiving the invitation is failing to parse the invite/from. From what I see the invite/from is a bare JID, and that is causing issues for Smack. Please let me know if I’m overlooking anything.

Here is a sample invite:

Please join me in a conference

However it appears Smack is hardcoded to require a Full JID:

MUCUserProvider.parseInvite() currently around line 101

EntityFullJid from = ParserUtils.getFullJidAttribute(parser, “from”);

XEP-0045 apparently does not require a Full JID

The room@service itself MUST then add a ‘from’ address to the element whose value is the bare JID, full JID, or occupant JID of the inviter and send the invitation to the invitee specified in the ‘to’ address; the room SHOULD add the password if the room is password-protected)

http://xmpp.org/extensions/xep-0045.html

Here is the error I receive consistently (with a test Open Fire server)

org.jxmpp.stringprep.XmppStringprepException: XmppStringprepException caused by ‘skinny@openfire.test.net’: org.jxmpp.stringprep.XmppStringprepException: XmppStringprepException caused by ‘skinny@openfire.test.net/’: org.jxmpp.stringprep.XmppStringprepException: Argument can’t be the empty string

at org.jxmpp.jid.impl.JidCreate.entityFullFrom(JidCreate.java:417)

at org.jivesoftware.smack.util.ParserUtils.getFullJidAttribute(ParserUtils.java:98 )

at org.jivesoftware.smackx.muc.provider.MUCUserProvider.parseInvite(MUCUserProvide r.java:89)

at org.jivesoftware.smackx.muc.provider.MUCUserProvider.parse(MUCUserProvider.java :55)

at org.jivesoftware.smackx.muc.provider.MUCUserProvider.parse(MUCUserProvider.java :37)

at org.jivesoftware.smack.provider.Provider.parse(Provider.java:31)

at org.jivesoftware.smack.util.PacketParserUtils.parseExtensionElement(PacketParse rUtils.java:917)

at org.jivesoftware.smack.util.PacketParserUtils.addExtensionElement(PacketParserU tils.java:1025)

at org.jivesoftware.smack.util.PacketParserUtils.parseMessage(PacketParserUtils.ja va:283)

at org.jivesoftware.smack.util.PacketParserUtils.parseStanza(PacketParserUtils.jav a:149)

at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMP PConnection.java:981)

at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$500(XMPPTCPConnection.java: 146)

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1007)

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:962)

at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:977)

at java.lang.Thread.run(Thread.java:818)

Fixed in 4.2.0-rc3-SNAPSHOT with Make MUC invitations ‘from’ value an EntityJid · Flowdalic/Smack@af1bde4 · GitHub . Please test and report back if it solves the issue.

Thanks Flow. Will this hit the nightly build tonight? Or will I have to pull and build to verify b/f it will be merged out? To date I have been pulling/running your beta binary distro.

It’s a snapshot build available on Maven Central’s snapshot repositories, which you can configure to be used in your build system (e.g. gradle or maven).

Yes, this corrects the issue. The invitation is now properly parsed and delivered to my listener code. Upgrading from a 4.2-beta build to 4.2-rc3 also corrected another issue I was seeing, so need to report it now! Thanks