}
@Override
public void onMessage(String message) {
GWT.log("Socket received: " + message);
IMessageResponse response = getResponse(message);
if(MessageType.login == response.getMessageType()){
GWT.log(response.getFrom()+" is online");
user.getOnline().add(response.getFrom());
getView().updateContact(new ContactInfo(response.getFrom(), true));
}else if(MessageType.logout == response.getMessageType()){
GWT.log(response.getFrom()+" is offline");
user.getOnline().remove(response.getFrom());
getView().updateContact(new ContactInfo(response.getFrom(), false));
}else if(MessageType.removeContact == response.getMessageType()){
removeContact(response.getFrom());
}else if(MessageType.addContact == response.getMessageType()){
appendFriend(response.getFrom());
}else{
addConversation(response.getFrom(), response);
getView().appendMessage(response.getFrom(), response);
}
}
@Override
public void onError(ChannelError error) {