On Wed, Apr 24, 2013 at 5:05 AM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Sat, Apr 20, 2013 at 10:50:09AM -0700, Anatol Pomozov wrote:
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> --- web/lib/pkgfuncs.inc.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
First off, I would like to have seen a rationale in the commit message. What does "to make it more visible" mean?
Also, canyonknight is working on a complete rewrite of the notification system.
canyonknight: Any comments on this one?
I would prefer not changing anything having to do with notifications on the AUR right now. Especially something like this patch that only results in a cosmetic change (in my opinion) and would only have to be re-implemented during the re-write. It's clear the notification system needs to see some action, so I'm going to write up a proposal for the notification system re-write and send it to this list later today.
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 53b7e54..ee150ca 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -260,11 +260,11 @@ function add_package_comment($pkgid, $uid, $comment) { $q.= "AND CommentNotify.UserID != " . $uid . " "; $q.= "AND CommentNotify.PkgID = " . intval($pkgid); $result = $dbh->query($q); - $bcc = array(); + $recipients = array();
if ($result) { while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - array_push($bcc, $row['Email']); + array_push($recipients, $row['Email']); }
$q = "SELECT Packages.* "; @@ -282,9 +282,10 @@ function add_package_comment($pkgid, $uid, $comment) { . $comment . "\n\n---\nIf you no longer wish to receive notifications about this package, please go the the above package page and click the UnNotify button."; $body = wordwrap($body, 70); - $bcc = implode(', ', $bcc); - $headers = "Bcc: $bcc\nReply-to: nobody@archlinux.org\nFrom: aur-notify@archlinux.org\nX-Mailer: AUR\n"; - @mail('undisclosed-recipients: ;', "AUR Comment for " . $row['Name'], $body, $headers); + $headers = "Reply-to: nobody@archlinux.org\nFrom: aur-notify@archlinux.org\nX-Mailer: AUR\n"; + foreach ($recipients as $to) { + @mail($to, "AUR Comment for " . $row['Name'], $body, $headers); + } } }
@@ -873,12 +874,12 @@ function pkg_delete ($atype, $ids, $mergepkgid) { $q.= "AND CommentNotify.UserID != " . uid_from_sid($_COOKIE['AURSID']) . " "; $q.= "AND CommentNotify.PkgID = " . $pkgid; $result = $dbh->query($q); - $bcc = array(); + $recipients = array();
while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - array_push($bcc, $row['Email']); + array_push($recipients, $row['Email']); } - if (!empty($bcc)) { + if (!empty($recipients)) { $pkgname = pkgname_from_id($pkgid);
# TODO: native language emails for users, based on their prefs @@ -893,9 +894,10 @@ function pkg_delete ($atype, $ids, $mergepkgid) { $body .= "You will no longer receive notifications about this package."; } $body = wordwrap($body, 70); - $bcc = implode(', ', $bcc); - $headers = "Bcc: $bcc\nReply-to: nobody@archlinux.org\nFrom: aur-notify@archlinux.org\nX-Mailer: AUR\n"; - @mail('undisclosed-recipients: ;', "AUR Package deleted: " . $pkgname, $body, $headers); + $headers = "Reply-to: nobody@archlinux.org\nFrom: aur-notify@archlinux.org\nX-Mailer: AUR\n"; + foreach ($recipients as $to) { + @mail($to, "AUR Package deleted: " . $pkgname, $body, $headers); + } } }
-- 1.8.2.1