Skip to content

Commit

Permalink
Use constant instead of using literal 'SPAM'
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavminhas committed Jul 29, 2024
1 parent 89b221c commit 3c72c98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions GmailAPIHelper/GmailHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static class GmailHelper
private const string _tokenFile = "token.json";
private const string _labelUnread = "UNREAD";
private const string _labelInbox = "INBOX";
private const string _labelSpam = "SPAM"

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Code Coverage (Codecov) (ubuntu-20.04, 3.1.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Code Coverage (Codecov) (ubuntu-20.04, 3.1.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Code Coverage (Codecov) (macOS-12, 3.1.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Code Coverage (Codecov) (macOS-12, 3.1.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Build (.NET Core) (ubuntu-20.04, 3.1.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Build (.NET Core) (ubuntu-20.04, 3.1.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Build (.NET Core) (ubuntu-20.04, 6.0.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Build (.NET Core) (ubuntu-20.04, 6.0.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Build (.NET Core) (macOS-12, 6.0.x)

; expected

Check failure on line 29 in GmailAPIHelper/GmailHelper.cs

View workflow job for this annotation

GitHub Actions / Build (.NET Core) (macOS-12, 6.0.x)

; expected

/// <summary>
/// 'Token Path Type' enum.
Expand Down Expand Up @@ -788,7 +789,7 @@ public static bool ReportSpamMessage(this GmailService gmailService, string quer
{
var mods = new ModifyMessageRequest
{
AddLabelIds = new List<string> { "SPAM" },
AddLabelIds = new List<string> { _labelSpam },
RemoveLabelIds = new List<string> { _labelInbox }
};
var service = gmailService;
Expand Down Expand Up @@ -841,7 +842,7 @@ public static int ReportSpamMessages(this GmailService gmailService, string quer
{
var mods = new ModifyMessageRequest
{
AddLabelIds = new List<string> { "SPAM" },
AddLabelIds = new List<string> { _labelSpam },
RemoveLabelIds = new List<string> { _labelInbox }
};
int counter = 0;
Expand Down Expand Up @@ -880,7 +881,7 @@ public static bool UnspamMessage(this GmailService gmailService, string query, s
var mods = new ModifyMessageRequest
{
AddLabelIds = new List<string> { _labelInbox },
RemoveLabelIds = new List<string> { "SPAM" }
RemoveLabelIds = new List<string> { _labelSpam }
};
var service = gmailService;
List<Message> result = new List<Message>();
Expand Down Expand Up @@ -933,7 +934,7 @@ public static int UnspamMessages(this GmailService gmailService, string query, s
var mods = new ModifyMessageRequest
{
AddLabelIds = new List<string> { _labelInbox },
RemoveLabelIds = new List<string> { "SPAM" }
RemoveLabelIds = new List<string> { _labelSpam }
};
int counter = 0;
var service = gmailService;
Expand Down

0 comments on commit 3c72c98

Please sign in to comment.