<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('peer.mail.Message', 'org.bugzilla.BugConstants');

  /**
   * Message to be sent to bugzilla's mailgateway
   *
   * <code>
   *   uses('org.bugzilla.gateway.BugMessage', 'peer.mail.transport.MailTransport');
   *
   *   $m= &new BugMessage(); {
   *     $m->setFrom(new InternetAddress('<EMAIL>', '<NAME>'));
   *     $m->addRecipient(TO, new InternetAddress('<EMAIL>'));
   *     $m->setSubject('Bug');
   *     $m->setProduct('MyProduct');
   *     $m->setComponent('My Component');
   *     $m->setShort_desc('Login page');
   *     $m->setBug_severity(BUG_SEVERITY_ENHANCEMENT);
   *     $m->setBody('This seems to be entirely broken. It shows a MySQL error.');
   *   }
   *
   *   $t= &new MailTransport();
   *   try(); {
   *     $t->connect();
   *     $t->send($m);
   *     $t->close();
   *   } if (catch('TransportException', $e)) {
   *     $e->printStackTrace();
   *     exit(-1);
   *   }
   *
   *   exit(0);
   * </code>
   *
   * @see      xp://peer.mail.Message
   * @purpose  Specialized mail message
   */
  class BugMessage extends Message {
    var
      $tokens= array();


    /**
     * Set Product
     *
     * @access  public
     * @param   string product
     */
    function setProduct($product) {
      $this->tokens['product']= $product;
    }

    /**
     * Set Component
     *
     * @access  public
     * @param   string component
     */
    function setComponent($component) {
      $this->tokens['component']= $component;
    }

    /**
     * Set Short_desc
     *
     * @access  public
     * @param   string short_desc
     */
    function setShort_desc($short_desc) {
      $this->tokens['short_desc']= $short_desc;
    }

    /**
     * Set Rep_platform
     *
     * @access  public
     * @param   string rep_platform
     */
    function setRep_platform($rep_platform) {
      $this->tokens['rep_platform']= $rep_platform;
    }

    /**
     * Set Bug_severity
     *
     * @access  public
     * @param   string bug_severity
     */
    function setBug_severity($bug_severity) {
      $this->tokens['bug_severity']= $bug_severity;
    }

    /**
     * Set Priority
     *
     * @access  public
     * @param   string priority
     */
    function setPriority($priority) {
      $this->tokens['priority']= $priority;
    }

    /**
     * Set Op_sys
     *
     * @access  public
     * @param   string op_sys
     */
    function setOp_sys($op_sys) {
      $this->tokens['op_sys']= $op_sys;
    }

    /**
     * Set Version
     *
     * @access  public
     * @param   string version
     */
    function setVersion($version) {
      $this->tokens['version']= $version;
    }

    /**
     * Get message body. If this message is contained in a folder and the body
     * has'nt been fetched yet, it'll be retrieved from the storage underlying
     * the folder.
     *
     * @access  public
     * @return  string
     */
    function getBody() {
      $header= '';
      foreach ($this->tokens as $key => $val) {
        $header.= '@'.$key.':'.$val."\n";
      }

      return $header."\n".parent::getBody();
    }    
  }
?><commit_msg>- suppress sending of success messages to users<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('peer.mail.Message', 'org.bugzilla.BugConstants');

  /**
   * Message to be sent to bugzilla's mailgateway
   *
   * <code>
   *   uses('org.bugzilla.gateway.BugMessage', 'peer.mail.transport.MailTransport');
   *
   *   $m= &new BugMessage(); {
   *     $m->setFrom(new InternetAddress('<EMAIL>', 'T<NAME>'));
   *     $m->addRecipient(TO, new InternetAddress('<EMAIL>'));
   *     $m->setSubject('Bug');
   *     $m->setProduct('MyProduct');
   *     $m->setComponent('My Component');
   *     $m->setShort_desc('Login page');
   *     $m->setBug_severity(BUG_SEVERITY_ENHANCEMENT);
   *     $m->setBody('This seems to be entirely broken. It shows a MySQL error.');
   *   }
   *
   *   $t= &new MailTransport();
   *   try(); {
   *     $t->connect();
   *     $t->send($m);
   *     $t->close();
   *   } if (catch('TransportException', $e)) {
   *     $e->printStackTrace();
   *     exit(-1);
   *   }
   *
   *   exit(0);
   * </code>
   *
   * @see      xp://peer.mail.Message
   * @purpose  Specialized mail message
   */
  class BugMessage extends Message {
    var
      $tokens= array();


    /**
     * Set Product
     *
     * @access  public
     * @param   string product
     */
    function setProduct($product) {
      $this->tokens['product']= $product;
    }

    /**
     * Set Component
     *
     * @access  public
     * @param   string component
     */
    function setComponent($component) {
      $this->tokens['component']= $component;
    }

    /**
     * Set Short_desc
     *
     * @access  public
     * @param   string short_desc
     */
    function setShort_desc($short_desc) {
      $this->tokens['short_desc']= $short_desc;
    }

    /**
     * Set Rep_platform
     *
     * @access  public
     * @param   string rep_platform
     */
    function setRep_platform($rep_platform) {
      $this->tokens['rep_platform']= $rep_platform;
    }

    /**
     * Set Bug_severity
     *
     * @access  public
     * @param   string bug_severity
     */
    function setBug_severity($bug_severity) {
      $this->tokens['bug_severity']= $bug_severity;
    }

    /**
     * Set Priority
     *
     * @access  public
     * @param   string priority
     */
    function setPriority($priority) {
      $this->tokens['priority']= $priority;
    }

    /**
     * Set Op_sys
     *
     * @access  public
     * @param   string op_sys
     */
    function setOp_sys($op_sys) {
      $this->tokens['op_sys']= $op_sys;
    }

    /**
     * Set Version
     *
     * @access  public
     * @param   string version
     */
    function setVersion($version) {
      $this->tokens['version']= $version;
    }
    
    /**
     * Suppress report mail when successful
     *
     * @access  public
     * @param   bool suppress
     */
    function setNoReport($b= TRUE) {
      $this->tokens['nomail']= ($b ? 'yes' : 'no');
    }    

    /**
     * Get message body. If this message is contained in a folder and the body
     * has'nt been fetched yet, it'll be retrieved from the storage underlying
     * the folder.
     *
     * @access  public
     * @return  string
     */
    function getBody() {
      $header= '';
      foreach ($this->tokens as $key => $val) {
        $header.= '@'.$key.':'.$val."\n";
      }

      return $header."\n".parent::getBody();
    }    
  }
?>
{'fraction_non_alphanumeric': 0.15971071267138767, 'fraction_numerical': 0.0006026819346090101, 'mean_word_length': 1.998193315266486, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3428759', 'n_tokens_mistral': 2236, 'n_tokens_neox': 2166, 'n_words': 438}