From 2413920bd4ac714157f1520bb30820c9460dd0de Mon Sep 17 00:00:00 2001 From: genteure Date: Sat, 10 Dec 2022 13:04:19 +0800 Subject: [PATCH] some cleanup and fixes --- src/Naprise.Service.MailKit/MailKitEmail.cs | 59 --------------------- src/dotnet-releaser.toml | 6 +++ 2 files changed, 6 insertions(+), 59 deletions(-) diff --git a/src/Naprise.Service.MailKit/MailKitEmail.cs b/src/Naprise.Service.MailKit/MailKitEmail.cs index 3c6471b..9ad6c71 100644 --- a/src/Naprise.Service.MailKit/MailKitEmail.cs +++ b/src/Naprise.Service.MailKit/MailKitEmail.cs @@ -152,65 +152,6 @@ public override async Task NotifyAsync(Message message, CancellationToken cancel await client.SendAsync(mime, cancellationToken).ConfigureAwait(false); await client.DisconnectAsync(true, cancellationToken).ConfigureAwait(false); - - // TODO build the message body - /* - var payload = new Payload - { - // TODO fill payload - // TODO check message.Type - }; - - var url = new Url($"{(true ? "https" : "http")}://{"localhost"}").AppendPathSegments("example"); - var content = JsonContent.Create(payload, options: null); - - cancellationToken.ThrowIfCancellationRequested(); - var resp = await this.HttpClientFactory().PostAsync(url, content, cancellationToken); - var respText = await resp.Content.ReadAsStringAsync(); - if (!resp.IsSuccessStatusCode) - { - throw new NapriseNotifyFailedException($"Failed to send notification to {nameof(MailKit)}: {resp.StatusCode}") // TODO change class name - { - Notifier = this, - Notification = message, - ResponseStatus = resp.StatusCode, - ResponseBody = respText, - }; - } - - try - { - var jobj = JsonDocument.Parse(respText); - // TODO parse response and check if it's successful - var status = jobj.RootElement.GetProperty("status").GetString(); - if (status != "ok") - { - var respMessage = jobj.RootElement.GetProperty("message").GetString(); - throw new NapriseNotifyFailedException($"Failed to send notification to {nameof(MailKit)}: \"{respMessage}\"") - { - Notifier = this, - Notification = message, - ResponseStatus = resp.StatusCode, - ResponseBody = respText, - }; - } - } - catch (Exception ex) - { - throw new NapriseNotifyFailedException($"Failed to send notification to {nameof(MailKit)}", ex) - { - Notifier = this, - Notification = message, - ResponseStatus = resp.StatusCode, - ResponseBody = respText, - }; - } - */ - } - - private class Payload - { - // TODO add payload } internal readonly struct EmailPlatform diff --git a/src/dotnet-releaser.toml b/src/dotnet-releaser.toml index 801b908..e413875 100644 --- a/src/dotnet-releaser.toml +++ b/src/dotnet-releaser.toml @@ -19,6 +19,12 @@ kinds = ["tar"] rid = ["osx-x64", "osx-arm64"] kinds = ["tar"] +[brew] +publish = false + +[scoop] +publish = false + [nuget] publish = true