whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Reverse the check: subscriber entry must match a user email
Date Wed, 06 Mar 2019 18:26:12 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 6c1a050  Reverse the check: subscriber entry must match a user email
6c1a050 is described below

commit 6c1a0505e79596e9a11bd3029eabdc1c649e0016
Author: Sebb <sebb@apache.org>
AuthorDate: Wed Mar 6 18:26:10 2019 +0000

    Reverse the check: subscriber entry must match a user email
---
 lib/whimsy/asf/mlist.rb | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/whimsy/asf/mlist.rb b/lib/whimsy/asf/mlist.rb
index d0af0da..d07285a 100644
--- a/lib/whimsy/asf/mlist.rb
+++ b/lib/whimsy/asf/mlist.rb
@@ -48,10 +48,11 @@ module ASF
       response[:subscriptions] = []
       response[:subtime] = (File.mtime(LIST_TIME) rescue File.mtime(LIST_SUBS))
 
+      _emails = emails.map{|email| ASF::Mail.to_canonical(email.downcase)}
       list_parse('sub') do |dom, list, subs|
-        emails.each do |email|
-          if downcase(subs).include? email.downcase
-            response[:subscriptions] << ["#{list}@#{dom}", email]
+        subs.each do |sub|
+          if _emails.include? ASF::Mail.to_canonical(sub.downcase)
+            response[:subscriptions] << ["#{list}@#{dom}", sub]
           end
         end
       end
@@ -70,10 +71,11 @@ module ASF
       response[:digests] = []
       response[:digtime] = (File.mtime(LIST_TIME) rescue File.mtime(LIST_DIGS))
 
+      _emails = emails.map{|email| ASF::Mail.to_canonical(email.downcase)}
       list_parse('dig') do |dom, list, subs|
-        emails.each do |email|
-          if downcase(subs).include? email.downcase
-            response[:digests] << ["#{list}@#{dom}", email]
+        subs.each do |sub|
+          if _emails.include? ASF::Mail.to_canonical(sub.downcase)
+            response[:digests] << ["#{list}@#{dom}", sub]
           end
         end
       end


Mime
View raw message