String self = (String)con.getChannelStorage().get("username");
//Now that I am registered to recieve connect message, then I
//tell everyone else that I am online.
ResponseBuilder response = new ResponseBuilder();
response.txnStatus(StrestUtil.HEADERS.TXN_STATUS_VALUES.CONTINUE);
response.contentUTF8(self);
notifyConnect.sendMessage(response.getResponse());
this.notifyConnect.addConnection(con);
//now we send the user the list of all currently connected users
for (String username : this.onlineNow.keySet()) {
if (username.equals(self)) {
continue; //don't need to notify about self
}
response = new ResponseBuilder();
response.txnStatus(StrestUtil.HEADERS.TXN_STATUS_VALUES.CONTINUE);
response.contentUTF8(username);
con.sendMessage(response);
}
}