powered by Jive Software

Chat.nextMessage() non blocking?

off of 2005.12.20 build

Just went and pasted example that uses :

Message message=newChat.nextMessage();

And it seems it is not blocking and return null. Is this a bug?

Ok. I think I know what happened.

From smack documentation:

Chat newChat = connection.createChat("jsmith@jivesoftware.com");

newMessage.setBody(“Hi, I’'m an annoying parrot-bot! Type something back to me.”);

while (true) {

// Wait for the next message the user types to us.

Message message = newChat.nextMessage();

// Send back the same text the other user sent us.

newChat.sendMessage(“got”+message.getBody());

}

It WAS receiving messages, but not messages the user was typing: it was receiving

…delivered and displayed…

Sure enough, the body of those events are null. so after every event, I would be sending “got”+null back.

So my question now is: is receiving those events in the nextMessage() the expected behavior and if so, then maybe the documentation in the smack document should mention this?

Thanks

Message was edited by:

passthrough:

I don’'t think this is the desired behavior of the nextMessage() method.

Alex