Skip to content

Commit 549ca4a

Browse files
authored
Merge pull request #221 from hognevevle/unfurl_links_fix
Allow explicit unfurl_links = false
2 parents f24ddc9 + 3313515 commit 549ca4a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

SlackAPI/SlackClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ public void PostMessage(
543543
bool linkNames = false,
544544
IBlock[] blocks = null,
545545
Attachment[] attachments = null,
546-
bool unfurl_links = false,
546+
bool? unfurl_links = null,
547547
string icon_url = null,
548548
string icon_emoji = null,
549549
bool? as_user = null,
@@ -579,8 +579,8 @@ public void PostMessage(
579579
NullValueHandling = NullValueHandling.Ignore
580580
})));
581581

582-
if (unfurl_links)
583-
parameters.Add(new Tuple<string, string>("unfurl_links", "1"));
582+
if (unfurl_links.HasValue)
583+
parameters.Add(new Tuple<string, string>("unfurl_links", unfurl_links.Value ? "true" : "false"));
584584

585585
if (!string.IsNullOrEmpty(icon_url))
586586
parameters.Add(new Tuple<string, string>("icon_url", icon_url));

SlackAPI/SlackTaskClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ public Task<PostMessageResponse> PostMessageAsync(
496496
bool linkNames = false,
497497
IBlock[] blocks = null,
498498
Attachment[] attachments = null,
499-
bool unfurl_links = false,
499+
bool? unfurl_links = null,
500500
string icon_url = null,
501501
string icon_emoji = null,
502502
bool as_user = false)
@@ -529,8 +529,8 @@ public Task<PostMessageResponse> PostMessageAsync(
529529
NullValueHandling = NullValueHandling.Ignore
530530
})));
531531

532-
if (unfurl_links)
533-
parameters.Add(new Tuple<string, string>("unfurl_links", "1"));
532+
if (unfurl_links.HasValue)
533+
parameters.Add(new Tuple<string, string>("unfurl_links", unfurl_links.Value ? "true" : "false"));
534534

535535
if (!string.IsNullOrEmpty(icon_url))
536536
parameters.Add(new Tuple<string, string>("icon_url", icon_url));

0 commit comments

Comments
 (0)