From 2506ee4821f8433f30e40cabd9e8dd24435fa95e Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Wed, 25 Nov 2026 08:51:15 -0500 Subject: [PATCH] Update to MailKit 5; eliminate warnings --- src/Data/DistributedCache.fs | 1 - src/Directory.Packages.props | 4 ++-- src/PrayerTracker/Email.fs | 7 +++++-- src/PrayerTracker/Extensions.fs | 1 - src/PrayerTracker/PrayerRequest.fs | 2 -- src/PrayerTracker/SmallGroup.fs | 1 - src/Tests/TestLocalization.fs | 2 +- src/UI/Help.fs | 3 +-- src/UI/SmallGroup.fs | 2 +- 9 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Data/DistributedCache.fs b/src/Data/DistributedCache.fs index c3684fe..5bcc84d 100644 --- a/src/Data/DistributedCache.fs +++ b/src/Data/DistributedCache.fs @@ -5,7 +5,6 @@ open System.Threading.Tasks open Microsoft.Extensions.Caching.Distributed open NodaTime open Npgsql -open Npgsql.FSharp /// Helper types and functions for the cache [] diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index e05ada3..e379c15 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -11,7 +11,7 @@ - + @@ -22,6 +22,6 @@ - + \ No newline at end of file diff --git a/src/PrayerTracker/Email.fs b/src/PrayerTracker/Email.fs index 27a68b6..7c41ba6 100644 --- a/src/PrayerTracker/Email.fs +++ b/src/PrayerTracker/Email.fs @@ -3,7 +3,6 @@ module PrayerTracker.Email open MailKit.Net.Smtp open Microsoft.Extensions.Localization -open MimeKit open PrayerTracker.Entities /// Parameters required to send an e-mail @@ -57,7 +56,9 @@ let getConnection () = task { do! client.AuthenticateAsync(smtpOptions.FromAddress, smtpOptions.Authentication) return client } - + +open MimeKit + /// Create a mail message object, filled with everything but the body content let createMessage opts = let msg = new MimeMessage() @@ -96,6 +97,8 @@ let createTextMessage opts = msg.Body <- new TextPart(TextFormat.Plain, Text = bodyText) msg +open MailKit + /// Send e-mails to a class let sendEmails opts = task { use htmlMsg = createHtmlMessage opts diff --git a/src/PrayerTracker/Extensions.fs b/src/PrayerTracker/Extensions.fs index 8c50073..f67ba00 100644 --- a/src/PrayerTracker/Extensions.fs +++ b/src/PrayerTracker/Extensions.fs @@ -68,7 +68,6 @@ type ClaimsPrincipal with open Giraffe -open Npgsql /// Extensions on the ASP.NET Core HTTP context type HttpContext with diff --git a/src/PrayerTracker/PrayerRequest.fs b/src/PrayerTracker/PrayerRequest.fs index 762a348..92c9ac3 100644 --- a/src/PrayerTracker/PrayerRequest.fs +++ b/src/PrayerTracker/PrayerRequest.fs @@ -77,8 +77,6 @@ let edit reqId : HttpHandler = requireAccess [ User ] >=> fun next ctx -> task { | Result.Error e -> return! e } -open Microsoft.Extensions.Configuration - // GET /prayer-requests/email/[date] let email date : HttpHandler = requireAccess [ User ] >=> fun next ctx -> task { let s = ctx.Strings diff --git a/src/PrayerTracker/SmallGroup.fs b/src/PrayerTracker/SmallGroup.fs index 143df7a..bfb316f 100644 --- a/src/PrayerTracker/SmallGroup.fs +++ b/src/PrayerTracker/SmallGroup.fs @@ -241,7 +241,6 @@ let savePreferences : HttpHandler = requireAccess [ User ] >=> validateCsrf >=> open Giraffe.ViewEngine open PrayerTracker.Views.CommonFunctions -open Microsoft.Extensions.Configuration // POST /small-group/announcement/send let sendAnnouncement : HttpHandler = requireAccess [ User ] >=> validateCsrf >=> fun next ctx -> task { diff --git a/src/Tests/TestLocalization.fs b/src/Tests/TestLocalization.fs index 10ac210..e4cf4c3 100644 --- a/src/Tests/TestLocalization.fs +++ b/src/Tests/TestLocalization.fs @@ -9,6 +9,6 @@ let _s = let asm = typeof.Assembly.GetName().Name let opts = { new IOptions with - member __.Value with get () = LocalizationOptions (ResourcesPath = "Resources") + member _.Value with get () = LocalizationOptions (ResourcesPath = "Resources") } ResourceManagerStringLocalizerFactory(opts, new NullLoggerFactory ()).Create("Common", asm) diff --git a/src/UI/Help.fs b/src/UI/Help.fs index 9271ffa..6e05ee2 100644 --- a/src/UI/Help.fs +++ b/src/UI/Help.fs @@ -3,7 +3,6 @@ module PrayerTracker.Views.Help open System.IO open Giraffe.ViewEngine -open PrayerTracker.ViewModels /// The help index page let index () = @@ -286,7 +285,7 @@ module User = /// Change Your Password let password () = - let s = I18N.localizer.Force() + let _ = I18N.localizer.Force() let l = I18N.forView "Help/User/Password" use sw = new StringWriter() let raw = rawLocText sw diff --git a/src/UI/SmallGroup.fs b/src/UI/SmallGroup.fs index 03e2817..ae6729e 100644 --- a/src/UI/SmallGroup.fs +++ b/src/UI/SmallGroup.fs @@ -619,7 +619,7 @@ let preferences (model : EditPreferences) ctx viewInfo = ] p [] [ rawText "*** " - raw l["If you want a custom color, you may be able to get some ideas (and a list of RGB values for those colors) from the W3 School's HTML color name list."] + raw l["If you want a custom color, you may be able to get some ideas (and a list of RGB values for those colors) from the W3 School's HTML color name list."] ] ] |> Layout.Content.standard