Require people replying to diary notifications to be subscribed
authorTom Hughes <tom@compton.nu>
Thu, 30 Aug 2018 17:34:15 +0000 (18:34 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 30 Aug 2018 17:34:15 +0000 (18:34 +0100)
script/deliver-message

index 15a9fbd..98e00d3 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
-  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+)-(.*)$/)