When “invitationReceived” get an invitation, i use
DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(20);
multiUserChat.join(RuntimeConstants.LoginUsername, password, history,timeout);
to join a room.
But it throw NoResponseException after “timeout” seconds.
I debugged the code in file AbstractXMPPConnection in method createPacketCollectorAndSend in line 649.
Is see no problems wrt to the exchanged stanzas. The initial presence (XEP-45 7.2.2)
is answered with
which should be matched by the responseFilter in MultiUserChat’s join() method, which is then used in the packet collector.
Note that the filter displayed in the screenshot does match a different MUC: aaaaa_0z2. Also note that alpha7 is the most recent version of Smack 4.1, But don’t think that it should matter in this case. I’ve also deleted your comment on github. Let’s keep the discussion in one place.
my app send message to join an room do not contains “from” attribute, is that necessary?
I debugged smack source in file AbstractXMPPConnection.java in line 649 mothed public PacketCollector createPacketCollectorAndSend(PacketFilter packetFilter, Packet packet), and can not find when add “packet” to the filed resultQueue in object packetCollector(add breakpoints at all the possible line).
my app send message to join an room do not contains “from” attribute, is that necessary?
In XMPP c2s, the from attribute is always implicitly the clients full JID (RFC 6120 8.1.2.1)
can not find when add "packet"
The stanza is added when the filter matches. How does the filter look in this case, and which stanza is it trying to filter? Try to figure that out before reading the answer.
The filter is created in Smack/MultiUserChat.java at master · igniterealtime/Smack · GitHub and does filter presence stanzas from the JID of the MUC occupant. For example, it should match the stanza with the id “XBxJG-11”. With the provided information, I can’t tell you why this doesn’t work in your case, but I hope to gave you enough information to debug the cause yourself.