1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 18:48:00 +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:
Matt Tucker 2003-04-13 04:49:27 +00:00 committed by mtucker
parent 3bf804d94d
commit 5ae662a257

View file

@ -138,12 +138,13 @@ public class GroupChat {
// field is in the form "roomName@service/nickname"
Presence joinPresence = new Presence(Presence.Type.AVAILABLE);
joinPresence.setTo(room + "/" + nickname);
connection.sendPacket(joinPresence);
// Wait for a presence packet back from the server.
PacketFilter responseFilter = new AndFilter(
new FromContainsFilter(room + "/" + nickname),
new PacketTypeFilter(Presence.class));
PacketCollector response = connection.createPacketCollector(responseFilter);
// Send join packet.
connection.sendPacket(joinPresence);
// Wait up to five seconds for a reply.
Presence presence = (Presence)response.nextResult(5000);
if (presence == null) {