@@ -806,31 +806,40 @@ userNotifyFeature ServerEnv{serverBaseURI, serverCron}
806
806
genDependencyUpdateList idx revIdx =
807
807
dependencyReleaseEmails (queryUserGroup . maintainersGroup) idx revIdx queryGetUserNotifyPref
808
808
809
- describeRevision users earlier now pkg =
810
- if pkgNumRevisions pkg <= 1
811
- then " Package upload, " ++ display (packageName pkg) ++ " , by " ++
812
- formatTimeUser users (pkgLatestUploadTime pkg) (pkgLatestUploadUser pkg)
813
- else " Package metadata revision(s), " ++ display (packageName pkg) ++ " :\n " ++
814
- unlines (map (uncurry (formatTimeUser users) . snd ) recentRevs)
809
+ describeRevision users earlier now pkg
810
+ | pkgNumRevisions pkg <= 1 =
811
+ " Package upload, " ++ display (packageName pkg) ++ " , by " ++
812
+ formatTimeUser users (pkgLatestUploadTime pkg) (pkgLatestUploadUser pkg)
813
+ | otherwise =
814
+ " Package metadata revision(s), " ++ display (packageName pkg) ++ " :\n " ++
815
+ unlines (map (uncurry (formatTimeUser users) . snd ) recentRevs)
815
816
where
816
817
revs = reverse $ Vec. toList (pkgMetadataRevisions pkg)
817
818
recentRevs = filter ((\ x -> x > earlier && x <= now) . fst . snd ) revs
818
819
819
- describeGroupAction users (time, uid, act, descr) =
820
- case act of
821
- (Admin_GroupAddUser tn (MaintainerGroup pkg)) -> Just $
822
- " Group modified by " ++ formatTimeUser users time uid ++ " :\n " ++
823
- display (Users. userIdToName users tn) ++ " added to maintainers for " ++ BS. unpack pkg ++
824
- " \n " ++ " Reason: " ++ BS. unpack descr
825
- (Admin_GroupDelUser tn (MaintainerGroup pkg)) -> Just $
826
- " Group modified by " ++ formatTimeUser users time uid ++ " :\n " ++
827
- display (Users. userIdToName users tn) ++ " removed from maintainers for " ++ BS. unpack pkg ++
828
- " \n " ++ " Reason: " ++ BS. unpack descr
820
+ describeGroupAction users (time, uid, act, reason) =
821
+ fmap
822
+ ( \ message ->
823
+ " Group modified by " ++ formatTimeUser users time uid ++ " :\n "
824
+ ++ message ++ " \n "
825
+ ++ " Reason: " ++ BS. unpack reason
826
+ )
827
+ $ case act of
828
+ (Admin_GroupAddUser tn (MaintainerGroup pkg)) ->
829
+ Just $
830
+ display (Users. userIdToName users tn)
831
+ <> " added to maintainers for "
832
+ <> BS. unpack pkg
833
+ (Admin_GroupDelUser tn (MaintainerGroup pkg)) ->
834
+ Just $
835
+ display (Users. userIdToName users tn)
836
+ <> " removed from maintainers for "
837
+ <> BS. unpack pkg
829
838
_ -> Nothing
830
839
831
- describeDocReport (pkg, doc ) =
840
+ describeDocReport (pkg, success ) =
832
841
" Package doc build for " ++ display (packageName pkg) ++ " :\n " ++
833
- if doc
842
+ if success
834
843
then " Build successful."
835
844
else " Build failed."
836
845
@@ -885,9 +894,7 @@ userNotifyFeature ServerEnv{serverBaseURI, serverCron}
885
894
mailParts = [[Part (T. pack " text/plain; charset=utf-8" )
886
895
None DefaultDisposition []
887
896
(PartContent $ BS. pack $
888
- intercalate " \n\n " ebody
889
- <> " \n\n "
890
- <> adjustmentLinkParagraph
897
+ intercalate " \n\n " (ebody <> [adjustmentLinkParagraph])
891
898
)
892
899
]]
893
900
}
0 commit comments