}
public void addParticipant(String participantName)
throws NoSuchAlgorithmException, UnsupportedEncodingException {
ByteIdentifier participantId = new ByteIdentifier(
Utility.sha1(participantName));
participants.add(participantId);
client.publishRootScope(sId.get(0), strategy, null);
ItemName updateData;
for (int i = 0; i < participants.size(); i++) {
updateData = new ItemName(sId, participants.get(i));
System.out.println("Sending new participant to all...");
Logger.log("Adding " + participantName + " to the conversation...");
client.publishItem(updateData, strategy, null);
event = client.getNextEvent();
System.out.println("got a notification");
prepareHeader(MsgType.NEWPART);
System.arraycopy(participantId, 0, sendMsg, 1,
participantId.length());
if (event.getType() == EventType.START_PUBLISH) {
client.publishData(event.getId(), sendMsg, strategy, null);
System.out.println("New participant sent...");