From 39bf92dd5349de210c40b9da2c9e8c882f2653e4 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Thu, 25 May 2023 21:42:32 -0700 Subject: [PATCH] Features/codeprojects/disable commit checks (#30) * hard disable for checking commits till I can debug it more * New HtmlCode method added --- Newsbot.Collector.Services/Jobs/CodeProjectWatcherJob.cs | 2 +- Newsbot.Collector.Services/Jobs/DiscordNotificationJob.cs | 2 +- .../Notifications/Discord/MessageValidation.cs | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Newsbot.Collector.Services/Jobs/CodeProjectWatcherJob.cs b/Newsbot.Collector.Services/Jobs/CodeProjectWatcherJob.cs index 9b78281..22891d4 100644 --- a/Newsbot.Collector.Services/Jobs/CodeProjectWatcherJob.cs +++ b/Newsbot.Collector.Services/Jobs/CodeProjectWatcherJob.cs @@ -68,7 +68,7 @@ public class CodeProjectWatcherJob foreach (var source in sources) { items.AddRange(CheckForReleases(source)); - items.AddRange(CheckForCommits(source)); + //items.AddRange(CheckForCommits(source)); } foreach (var item in items) diff --git a/Newsbot.Collector.Services/Jobs/DiscordNotificationJob.cs b/Newsbot.Collector.Services/Jobs/DiscordNotificationJob.cs index e748833..57af19a 100644 --- a/Newsbot.Collector.Services/Jobs/DiscordNotificationJob.cs +++ b/Newsbot.Collector.Services/Jobs/DiscordNotificationJob.cs @@ -157,7 +157,7 @@ public class DiscordNotificationJob { Title = article.Title, Color = DiscordMessageEmbedColors.Red, - Description = article.Description, + Description = MessageValidation.ConvertHtmlCodes(article.Description), Author = new DiscordMessageEmbedAuthor { Name = article.AuthorName, diff --git a/Newsbot.Collector.Services/Notifications/Discord/MessageValidation.cs b/Newsbot.Collector.Services/Notifications/Discord/MessageValidation.cs index 4aaa3fa..cba8ff6 100644 --- a/Newsbot.Collector.Services/Notifications/Discord/MessageValidation.cs +++ b/Newsbot.Collector.Services/Notifications/Discord/MessageValidation.cs @@ -11,7 +11,7 @@ public class MessageValidation } } - + public static bool IsEmbedFooterValid(DiscordMessageEmbed[] embeds) { if (embeds.Count() == 0) @@ -43,6 +43,12 @@ public class MessageValidation return true; } + public static string ConvertHtmlCodes(string message) + { + message = message.Replace("'", "'"); + return message; + } + public static bool IsEmbedAuthorValid(DiscordMessageEmbedAuthor author) { return true;