@@ -52,6 +52,7 @@ import Distribution.Server.Features.Tags
52
52
import Distribution.Server.Features.Upload
53
53
import Distribution.Server.Features.UserDetails
54
54
import Distribution.Server.Features.Users
55
+ import Distribution.Server.Features.Vouch
55
56
56
57
import Distribution.Server.Util.Email
57
58
@@ -437,6 +438,7 @@ initUserNotifyFeature :: ServerEnv
437
438
-> ReportsFeature
438
439
-> TagsFeature
439
440
-> ReverseFeature
441
+ -> VouchFeature
440
442
-> IO UserNotifyFeature )
441
443
initUserNotifyFeature env@ ServerEnv { serverStateDir, serverTemplatesDir,
442
444
serverTemplatesMode } = do
@@ -448,10 +450,10 @@ initUserNotifyFeature env@ServerEnv{ serverStateDir, serverTemplatesDir,
448
450
[serverTemplatesDir, serverTemplatesDir </> " UserNotify" ]
449
451
[ " user-notify-form.html" ]
450
452
451
- return $ \ users core uploadfeature adminlog userdetails reports tags revers -> do
453
+ return $ \ users core uploadfeature adminlog userdetails reports tags revers vouch -> do
452
454
let feature = userNotifyFeature env
453
455
users core uploadfeature adminlog userdetails reports tags
454
- revers notifyState templates
456
+ revers vouch notifyState templates
455
457
return feature
456
458
457
459
data InRange = InRange | OutOfRange
@@ -582,6 +584,7 @@ userNotifyFeature :: ServerEnv
582
584
-> ReportsFeature
583
585
-> TagsFeature
584
586
-> ReverseFeature
587
+ -> VouchFeature
585
588
-> StateComponent AcidState NotifyData
586
589
-> Templates
587
590
-> UserNotifyFeature
@@ -594,6 +597,7 @@ userNotifyFeature serverEnv@ServerEnv{serverCron}
594
597
ReportsFeature {.. }
595
598
TagsFeature {.. }
596
599
ReverseFeature {queryReverseIndex}
600
+ VouchFeature {drainQueuedNotifications}
597
601
notifyState templates
598
602
= UserNotifyFeature {.. }
599
603
@@ -709,6 +713,8 @@ userNotifyFeature serverEnv@ServerEnv{serverCron}
709
713
revIdx <- liftIO queryReverseIndex
710
714
dependencyUpdateNotifications <- concatMapM (genDependencyUpdateList notifyPrefs idx revIdx . pkgInfoToPkgId) revisionsAndUploads
711
715
716
+ vouchNotifications <- fmap (, NotifyVouchingCompleted ) <$> drainQueuedNotifications
717
+
712
718
emails <-
713
719
getNotificationEmails serverEnv userDetailsFeature users $
714
720
concat
@@ -717,6 +723,7 @@ userNotifyFeature serverEnv@ServerEnv{serverCron}
717
723
, docReportNotifications
718
724
, tagProposalNotifications
719
725
, dependencyUpdateNotifications
726
+ , vouchNotifications
720
727
]
721
728
mapM_ sendNotifyEmailAndDelay emails
722
729
@@ -897,6 +904,7 @@ data Notification
897
904
-- ^ Packages maintained by user that depend on updated dep
898
905
, notifyTriggerBounds :: NotifyTriggerBounds
899
906
}
907
+ | NotifyVouchingCompleted
900
908
deriving (Show )
901
909
902
910
data NotifyMaintainerUpdateType = MaintainerAdded | MaintainerRemoved
@@ -1021,6 +1029,10 @@ getNotificationEmails
1021
1029
notifyWatchedPackages
1022
1030
, DependencyNotification notifyPackageId
1023
1031
)
1032
+ NotifyVouchingCompleted ->
1033
+ generalNotification
1034
+ renderNotifyVouchingCompleted
1035
+
1024
1036
where
1025
1037
generalNotification = (, GeneralNotification )
1026
1038
@@ -1086,6 +1098,13 @@ getNotificationEmails
1086
1098
]
1087
1099
<> EmailContentList (map renderPkgLink revDeps)
1088
1100
1101
+ renderNotifyVouchingCompleted =
1102
+ EmailContentParagraph
1103
+ " You have received all necessary endorsements. \
1104
+ \You have been added the the 'uploaders' group. \
1105
+ \You can now upload packages to Hackage. \
1106
+ \Note that packages cannot be deleted, so be careful."
1107
+
1089
1108
{- ---- Rendering helpers -----}
1090
1109
1091
1110
renderPackageName = emailContentStr . unPackageName
0 commit comments