return $this->register_optional($this->sa, $email);
}
+ private $with_rf = false;
+ /** Allows filtering by active redirection.
+ * @return Suffix to use to access the adequate table.
+ */
+ public function addActiveEmailRedirectFilter($email = null)
+ {
+ $this->requireAccounts();
+ $this->with_rf = true;
+ }
+
protected function emailJoins()
{
global $globals;
$joins['sa' . $sub] = PlSqlJoin::left('email_source_account', '$ME.uid = $UID AND $ME.email IN {?}', $emails);
}
}
+ if ($this->with_rf) {
+ $joins['rf'] = PlSqlJoin::left('email_redirect_account', '$ME.uid = $UID AND $ME.type != \'imap\' AND $ME.flags = \'active\'');;
+ }
return $joins;
}
{
public function buildCondition(PlFilter $uf)
{
- $sub_redirect = $uf->addEmailRedirectFilter();
- return 'ra' . $sub_redirect . '.flags = \'active\'';
+ $sub_redirect = $uf->addActiveEmailRedirectFilter();
+ return 'rf.redirect IS NOT NULL';
}
public function export()