mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +01:00
Minor logic fix.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1886 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
3bf804d94d
commit
5ae662a257
1 changed files with 2 additions and 1 deletions
|
@ -138,12 +138,13 @@ public class GroupChat {
|
||||||
// field is in the form "roomName@service/nickname"
|
// field is in the form "roomName@service/nickname"
|
||||||
Presence joinPresence = new Presence(Presence.Type.AVAILABLE);
|
Presence joinPresence = new Presence(Presence.Type.AVAILABLE);
|
||||||
joinPresence.setTo(room + "/" + nickname);
|
joinPresence.setTo(room + "/" + nickname);
|
||||||
connection.sendPacket(joinPresence);
|
|
||||||
// Wait for a presence packet back from the server.
|
// Wait for a presence packet back from the server.
|
||||||
PacketFilter responseFilter = new AndFilter(
|
PacketFilter responseFilter = new AndFilter(
|
||||||
new FromContainsFilter(room + "/" + nickname),
|
new FromContainsFilter(room + "/" + nickname),
|
||||||
new PacketTypeFilter(Presence.class));
|
new PacketTypeFilter(Presence.class));
|
||||||
PacketCollector response = connection.createPacketCollector(responseFilter);
|
PacketCollector response = connection.createPacketCollector(responseFilter);
|
||||||
|
// Send join packet.
|
||||||
|
connection.sendPacket(joinPresence);
|
||||||
// Wait up to five seconds for a reply.
|
// Wait up to five seconds for a reply.
|
||||||
Presence presence = (Presence)response.nextResult(5000);
|
Presence presence = (Presence)response.nextResult(5000);
|
||||||
if (presence == null) {
|
if (presence == null) {
|
||||||
|
|
Loading…
Reference in a new issue