Package voxo.common.entities

Examples of voxo.common.entities.Contact


    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);
View Full Code Here


    if (cu == null) {
      throw new RequestException(Messages.getString("ContactAcceptAction.ERR_ContactUserNotFound")); //$NON-NLS-1$
    }

    // Get existing contact
    Contact c = new Contact(null, cu.getUserId(), u.getUserId(), null);
    ArrayList<Contact> alc = ContactManager.searchContactAbsolute(c);
    if (alc.size() != 1) {
      throw new RequestException(Messages.getString("ContactAcceptAction.ERR_AlreadyContact")); //$NON-NLS-1$
    }

    // Update contact status
    Contact cAccept = alc.get(0);
    cAccept.setAccepted(true);
    ContactManager.updateContact(cAccept);

    // Notify users
    new SendContactListAction(u);
    new SendMessageAction(cu.getUsername() + Messages.getString("ContactAcceptAction.ResponseSelf"), u, EnumPacket.SERVER_Notice); //$NON-NLS-1$
View Full Code Here

      throw new RequestException(Messages.getString("ContactRemoveAction.ERR_UserNotFound")); //$NON-NLS-1$
    }
    if (cu == null) {
      throw new RequestException(Messages.getString("ContactRemoveAction.ERR_ContactUserNotFound")); //$NON-NLS-1$
    }
    Contact c = ContactManager.searchContactAbsolute(new Contact(null, cu.getUserId(), u.getUserId(), null)).get(0);
    if (c == null) {
      throw new RequestException(Messages.getString("ContactRemoveAction.ERR_ContactNotFound")); //$NON-NLS-1$
    }

    // Delete contact
View Full Code Here

TOP

Related Classes of voxo.common.entities.Contact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.