Issue: MultiUserChatManager.setAutoJoinOnReconnect(true) fails for password protected rooms

This is about smack-extensions-4.2.2. I connect successfully to a password protected MUC room with:

            MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
	manager.setAutoJoinOnReconnect(true);
	EntityBareJid roomJid = JidCreate.entityBareFrom(room);
	MultiUserChat muc = manager.getMultiUserChat(roomJid);
	Resourcepart nick = Resourcepart.from(connection.getUser().getLocalpartOrThrow().toString());
	MucEnterConfiguration config = muc.getEnterConfigurationBuilder(nick).requestNoHistory()
			.withPassword(roomPassword).build();
	muc.join(config);

I expect when reconnection happens, that smack would automatically rejoin that room with that password as well. What happens:

org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPP error reply received from arbitrageurs.lowvolume@conference.jabber.piratenpartei.de/lowvolume: XMPPError: not-authorized - auth
at org.jivesoftware.smack.XMPPException$XMPPErrorException.ifHasErrorThenThrow(XMPPException.java:131) ~[smack-core-4.2.2.jar!/:4.2.2]
at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:256) ~[smack-core-4.2.2.jar!/:4.2.2]
at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:355) ~[smack-extensions-4.2.2.jar!/:4.2.2]
at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:711) ~[smack-extensions-4.2.2.jar!/:4.2.2]
at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:603) ~[smack-extensions-4.2.2.jar!/:4.2.2]
at org.jivesoftware.smackx.muc.MultiUserChatManager$3$1.run(MultiUserChatManager.java:214) ~[smack-extensions-4.2.2.jar!/:4.2.2]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]

From what I can tell, it looks like the rejoin code doesn’t consider a room’s password.

I guess this is the place to report issues, yes? Couldn’t do that neither on your Jira not Github.

1 Like

That is probably true.

Thanks for reporting this. I’ve created SMACK-797. Patches welcome. :wink: