1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fixed: Sending Slack notifications without an icon

This commit is contained in:
Mark McDowall 2017-07-05 09:16:50 -07:00
parent e10717f6bb
commit 197febe9db
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0

View File

@ -115,14 +115,17 @@ private SlackPayload CreatePayload(string message, List<Attachment> attachments
Attachments = attachments
};
// Set the correct icon based on the value
if (icon.StartsWith(":") && icon.EndsWith(":"))
if (icon.IsNotNullOrWhiteSpace())
{
payload.IconEmoji = icon;
}
else if (icon.IsNotNullOrWhiteSpace())
{
payload.IconUrl = icon;
// Set the correct icon based on the value
if (icon.StartsWith(":") && icon.EndsWith(":"))
{
payload.IconEmoji = icon;
}
else
{
payload.IconUrl = icon;
}
}
return payload;