powered by Jive Software

How to create one2OneChat?

Hi,

I created a chat object with connection.createChat("…") and was able to send a message, but how does the other side join the chat.

I’'m trying to write somthing like this:

(1) user A creates a chat to user B and send a message to him

(2) user B will see an alert indicating there is a message

(3) user B will join the chat

So, how can I first check for messages, and second, how can user B join a chat?

Thanks,

Silvio

User A creates chat and sends to user b.

Chat chat = connection.createChat(“userb”);

Message message = chat.createMessage();

message.setBody(“Hi”);

User B has a packetListener listining for all messages in the processPacket method.

public void processPacket(Packet packet){

Message message = (Message)packet;

String from = message.getFrom();

//Create chat and send message back.

Chat chat = connection.createChat(from);

}