if (u == null) {
throw new RequestException(Messages.getString("ContactAddAction.ERR_UserNotFound")); //$NON-NLS-1$
}
// Check for existing contact
Contact c = new Contact(null, u.getUserId(), cu.getUserId(), null);
ArrayList<Contact> alc = ContactManager.searchContactAbsolute(c);
if (alc.size() > 0) {
new SendMessageAction(Messages.getString("ContactAddAction.AlreadySent"), u, EnumPacket.SERVER_Error); //$NON-NLS-1$
throw new RequestException(Messages.getString("ContactAddAction.ERR_AlreadyContact")); //$NON-NLS-1$
}
// Add contact
ContactManager.addContact(new Contact(null, u.getUserId(), cu.getUserId(), false));
// Notify users
new SendMessageAction(String.format(Messages.getString("ContactAddAction.ResponseTarget"), u.getUsername()), cu, EnumPacket.SERVER_Notice); //$NON-NLS-1$
if(cu.getOnline() == true) {
new SendContactListAction(cu);