Nway invites allow multiple users to communicate in a single chat session. This article specifies the process to create a Nway invite programmatically using Sametime Java toolkit and sending it other users.
Step1: Add following import statements:
import com.lotus.sametime.post.PostService;
import com.lotus.sametime.post.Post;
import com.lotus.sametime.core.types.STUser;
import com.lotus.sametime.core.types.STId;
Step2: Add the following function. This function demonstrates the process of creating and sending N-Way invite:
public void createNwayInvite() {
com.lotus.sametime.core.util.NdrOutputStream ndrOutputStream = new com.lotus.sametime.core.util.NdrOutputStream();
try {
ndrOutputStream.writeLong(0);
ndrOutputStream.writeBoolean(false);
ndrOutputStream.writeShort(0);
ndrOutputStream.writeUTF("<Custom PlaceID>");
ndrOutputStream.writeUTF("");
ndrOutputStream.writeUTF("<YourSametimeServer.com>");
ndrOutputStream.writeBoolean(false);
ndrOutputStream.writeBoolean(false);
ndrOutputStream.writeUTF("");
ndrOutputStream.writeUTF("");
ndrOutputStream.writeUTF("");
ndrOutputStream.writeLong(0);
} catch (IOException ex1) {
ex1.printStackTrace();
}
STUser STUser = new STUser(new STId("<User STID>",""),"","");
STUser[] STUsers = new STUser[] { STUser};
_Post = _PostService.createPost(25,"<Place Title>","<Message:Join the meeting>",0,ndrOutputStream.toByteArray(),STUsers,true);
_Post.addPostListener(this);
_Post.send();
}