]> git.openstreetmap.org Git - rails.git/blobdiff - script/deliver-message
Require people replying to diary notifications to be subscribed
[rails.git] / script / deliver-message
index 15a9fbdc7f613f7d14cb9b6119a6dc7719d39afc..98e00d3328bdbab946a0e07f33f529b9182cc4ea 100755 (executable)
@@ -6,7 +6,7 @@ if recipient = ARGV[0].match(/^c-(\d+)-(\d+)-(.*)$/)
   comment = DiaryComment.find(recipient[1])
   digest = comment.digest
   date = comment.created_at
   comment = DiaryComment.find(recipient[1])
   digest = comment.digest
   date = comment.created_at
-  from = User.find(recipient[2])
+  from = comment.diary_entry.subscribers.find(recipient[2])
   to = comment.user
   token = recipient[3]
 elsif recipient = ARGV[0].match(/^m-(\d+)-(.*)$/)
   to = comment.user
   token = recipient[3]
 elsif recipient = ARGV[0].match(/^m-(\d+)-(.*)$/)