public function __construct(HeraldEffect $effect, $applied, $reason = null)
 {
     $this->setAction($effect->getAction());
     $this->setTarget($effect->getTarget());
     if ($effect->getRule()) {
         $this->setRuleID($effect->getRule()->getID());
     }
     $this->setReason($effect->getReason());
     $this->setApplied($applied);
     $this->setAppliedReason($reason);
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $phid = $effect->getRule()->getAuthorPHID();
     // For personal rules, we'll force delivery of a real email. This effect
     // is stronger than notification preferences, so you get an actual email
     // even if your preferences are set to "Notify" or "Ignore".
     return $this->applyEmail(array($phid), $force = true);
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $phid = $this->getAdapter()->getPHID();
     $rule = $effect->getRule();
     $author = $rule->getAuthor();
     $flag = PhabricatorFlagQuery::loadUserFlag($author, $phid);
     if ($flag) {
         $this->logEffect(self::DO_IGNORE, $flag->getColor());
         return;
     }
     $flag = id(new PhabricatorFlag())->setOwnerPHID($author->getPHID())->setType(phid_get_type($phid))->setObjectPHID($phid)->setReasonPHID($rule->getPHID())->setColor($effect->getTarget())->setNote('')->save();
     $this->logEffect(self::DO_FLAG, $flag->getColor());
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $phid = $effect->getRule()->getAuthorPHID();
     return $this->applySubscribe(array($phid), $is_add = false);
 }
 /**
  * @task apply
  */
 protected function applyStandardEffect(HeraldEffect $effect)
 {
     $action = $effect->getAction();
     $rule_type = $effect->getRule()->getRuleType();
     $impl = $this->getActionImplementation($action);
     if (!$impl) {
         return new HeraldApplyTranscript($effect, false, array(array(HeraldAction::DO_STANDARD_INVALID_ACTION, $action)));
     }
     if (!$impl->supportsRuleType($rule_type)) {
         return new HeraldApplyTranscript($effect, false, array(array(HeraldAction::DO_STANDARD_WRONG_RULE_TYPE, $rule_type)));
     }
     $impl->applyEffect($this->getObject(), $effect);
     return $impl->getApplyTranscript($effect);
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $phid = $effect->getRule()->getAuthorPHID();
     return $this->applyAssign(array($phid));
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $rule = $effect->getRule();
     $author_phid = $rule->getAuthorPHID();
     $this->applyRouting($rule, PhabricatorMailRoutingRule::ROUTE_AS_MAIL, array($author_phid));
 }
Example #8
0
 /**
  * @task apply
  */
 private function applyEmailEffect(HeraldEffect $effect)
 {
     foreach ($effect->getTarget() as $phid) {
         $this->emailPHIDs[$phid] = $phid;
         // If this is a personal rule, we'll force delivery of a real email. This
         // effect is stronger than notification preferences, so you get an actual
         // email even if your preferences are set to "Notify" or "Ignore".
         $rule = $effect->getRule();
         if ($rule->isPersonalRule()) {
             $this->forcedEmailPHIDs[$phid] = $phid;
         }
     }
     return new HeraldApplyTranscript($effect, true, pht('Added mailable to mail targets.'));
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $rule = $effect->getRule();
     $phid = $rule->getAuthorPHID();
     return $this->applyAuditors(array($phid), $rule);
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $phid = $effect->getRule()->getAuthorPHID();
     return $this->applyReviewers(array($phid), $is_blocking = false);
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     return $this->applyBuilds($effect->getTarget(), $effect->getRule());
 }
 public function applyEffect($object, HeraldEffect $effect)
 {
     $rule = $effect->getRule();
     return $this->applyAuditors($effect->getTarget(), $rule);
 }