/**
  * Validates the given participant.
  * 
  * @param	\wcf\data\user\UserProfile	$user
  * @param	string				$field
  */
 public static function validateParticipant(UserProfile $user, $field = 'participants')
 {
     // check participant's settings and permissions
     if (!$user->getPermission('user.conversation.canUseConversation')) {
         throw new UserInputException($field, 'canNotUseConversation');
     }
     if (!WCF::getSession()->getPermission('user.profile.cannotBeIgnored')) {
         // check if user wants to receive any conversations
         if ($user->canSendConversation == 2) {
             throw new UserInputException($field, 'doesNotAcceptConversation');
         }
         // check if user only wants to receive conversations by
         // users they are following and if the active user is followed
         // by the relevant user
         if ($user->canSendConversation == 1 && !$user->isFollowing(WCF::getUser()->userID)) {
             throw new UserInputException($field, 'doesNotAcceptConversation');
         }
         // active user is ignored by participant
         if ($user->isIgnoredUser(WCF::getUser()->userID)) {
             throw new UserInputException($field, 'ignoresYou');
         }
         // check participant's mailbox quota
         if (ConversationHandler::getInstance()->getConversationCount($user->userID) >= $user->getPermission('user.conversation.maxConversations')) {
             throw new UserInputException($field, 'mailboxIsFull');
         }
     }
 }