Update to MailKit 5; eliminate warnings

This commit is contained in:
danieljsummers committed 2026-11-25 08:51:15 -05:00
1 parent 27d3f80f5a
commit 2506ee4821
9 files changed
+10 -13

No files matched your search

-1
View File
@@ -5,7 +5,6 @@ open System.Threading.Tasks
open Microsoft.Extensions.Caching.Distributed open Microsoft.Extensions.Caching.Distributed
open NodaTime open NodaTime
open Npgsql open Npgsql
open Npgsql.FSharp
/// Helper types and functions for the cache /// Helper types and functions for the cache
[<AutoOpen>] [<AutoOpen>]
+2 -2
View File
@@ -11,7 +11,7 @@
<PackageVersion Include="Giraffe.Htmx" Version="2.0.11" /> <PackageVersion Include="Giraffe.Htmx" Version="2.0.11" />
<PackageVersion Include="Giraffe.ViewEngine" Version="1.4.0" /> <PackageVersion Include="Giraffe.ViewEngine" Version="1.4.0" />
<PackageVersion Include="Giraffe.ViewEngine.Htmx" Version="2.0.11" /> <PackageVersion Include="Giraffe.ViewEngine.Htmx" Version="2.0.11" />
<PackageVersion Include="MailKit" Version="4.18.2" /> <PackageVersion Include="MailKit" Version="5.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.3.14" /> <PackageVersion Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.3.14" />
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.14" /> <PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.14" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Extensions" Version="2.3.14" /> <PackageVersion Include="Microsoft.AspNetCore.Http.Extensions" Version="2.3.14" />
@@ -22,6 +22,6 @@
<PackageVersion Include="NodaTime.Serialization.JsonNet" Version="3.3.0" /> <PackageVersion Include="NodaTime.Serialization.JsonNet" Version="3.3.0" />
<PackageVersion Include="NodaTime.Testing" Version="3.3.7" /> <PackageVersion Include="NodaTime.Testing" Version="3.3.7" />
<PackageVersion Include="Npgsql.FSharp" Version="8.0.0" /> <PackageVersion Include="Npgsql.FSharp" Version="8.0.0" />
<PackageVersion Include="Npgsql.NodaTime" Version="10.0.3" /> <PackageVersion Include="Npgsql.NodaTime" Version="11.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+5 -2
View File
@@ -3,7 +3,6 @@ module PrayerTracker.Email
open MailKit.Net.Smtp open MailKit.Net.Smtp
open Microsoft.Extensions.Localization open Microsoft.Extensions.Localization
open MimeKit
open PrayerTracker.Entities open PrayerTracker.Entities
/// Parameters required to send an e-mail /// Parameters required to send an e-mail
@@ -57,7 +56,9 @@ let getConnection () = task {
do! client.AuthenticateAsync(smtpOptions.FromAddress, smtpOptions.Authentication) do! client.AuthenticateAsync(smtpOptions.FromAddress, smtpOptions.Authentication)
return client return client
} }
open MimeKit
/// Create a mail message object, filled with everything but the body content /// Create a mail message object, filled with everything but the body content
let createMessage opts = let createMessage opts =
let msg = new MimeMessage() let msg = new MimeMessage()
@@ -96,6 +97,8 @@ let createTextMessage opts =
msg.Body <- new TextPart(TextFormat.Plain, Text = bodyText) msg.Body <- new TextPart(TextFormat.Plain, Text = bodyText)
msg msg
open MailKit
/// Send e-mails to a class /// Send e-mails to a class
let sendEmails opts = task { let sendEmails opts = task {
use htmlMsg = createHtmlMessage opts use htmlMsg = createHtmlMessage opts
-1
View File
@@ -68,7 +68,6 @@ type ClaimsPrincipal with
open Giraffe open Giraffe
open Npgsql
/// Extensions on the ASP.NET Core HTTP context /// Extensions on the ASP.NET Core HTTP context
type HttpContext with type HttpContext with
-2
View File
@@ -77,8 +77,6 @@ let edit reqId : HttpHandler = requireAccess [ User ] >=> fun next ctx -> task {
| Result.Error e -> return! e | Result.Error e -> return! e
} }
open Microsoft.Extensions.Configuration
// GET /prayer-requests/email/[date] // GET /prayer-requests/email/[date]
let email date : HttpHandler = requireAccess [ User ] >=> fun next ctx -> task { let email date : HttpHandler = requireAccess [ User ] >=> fun next ctx -> task {
let s = ctx.Strings let s = ctx.Strings
-1
View File
@@ -241,7 +241,6 @@ let savePreferences : HttpHandler = requireAccess [ User ] >=> validateCsrf >=>
open Giraffe.ViewEngine open Giraffe.ViewEngine
open PrayerTracker.Views.CommonFunctions open PrayerTracker.Views.CommonFunctions
open Microsoft.Extensions.Configuration
// POST /small-group/announcement/send // POST /small-group/announcement/send
let sendAnnouncement : HttpHandler = requireAccess [ User ] >=> validateCsrf >=> fun next ctx -> task { let sendAnnouncement : HttpHandler = requireAccess [ User ] >=> validateCsrf >=> fun next ctx -> task {
+1 -1
View File
@@ -9,6 +9,6 @@ let _s =
let asm = typeof<Common>.Assembly.GetName().Name let asm = typeof<Common>.Assembly.GetName().Name
let opts = let opts =
{ new IOptions<LocalizationOptions> with { new IOptions<LocalizationOptions> with
member __.Value with get () = LocalizationOptions (ResourcesPath = "Resources") member _.Value with get () = LocalizationOptions (ResourcesPath = "Resources")
} }
ResourceManagerStringLocalizerFactory(opts, new NullLoggerFactory ()).Create("Common", asm) ResourceManagerStringLocalizerFactory(opts, new NullLoggerFactory ()).Create("Common", asm)
+1 -2
View File
@@ -3,7 +3,6 @@ module PrayerTracker.Views.Help
open System.IO open System.IO
open Giraffe.ViewEngine open Giraffe.ViewEngine
open PrayerTracker.ViewModels
/// The help index page /// The help index page
let index () = let index () =
@@ -286,7 +285,7 @@ module User =
/// Change Your Password /// Change Your Password
let password () = let password () =
let s = I18N.localizer.Force() let _ = I18N.localizer.Force()
let l = I18N.forView "Help/User/Password" let l = I18N.forView "Help/User/Password"
use sw = new StringWriter() use sw = new StringWriter()
let raw = rawLocText sw let raw = rawLocText sw
+1 -1
View File
@@ -619,7 +619,7 @@ let preferences (model : EditPreferences) ctx viewInfo =
] ]
p [] [ p [] [
rawText "*** " 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 <a href=\"http://www.w3schools.com/html/html_colornames.asp\" title=\"HTML Color List - W3 School\">HTML color name list</a>."] 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 <a href=\"https://www.w3schools.com/html/html_colornames.asp\" title=\"HTML Color List - W3 School\">HTML color name list</a>."]
] ]
] ]
|> Layout.Content.standard |> Layout.Content.standard