Skip to content

Commit

Permalink
Don't gist non-empty messages
Browse files Browse the repository at this point in the history
Now `$x but FileStore(…)` will only gist if $x is long.
  • Loading branch information
AlexDaniel committed Aug 29, 2018
1 parent 3e8e189 commit fda7e52
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Whateverable.pm6
Expand Up @@ -597,9 +597,10 @@ method process-code($code is copy, $msg) {
!! write-code $code.subst: :g, , \n
}

multi method filter($response where (.encode.elems > MESSAGE-LIMIT
or ?.?additional-files
or (!~$_ and $_ ~~ ProperStr))) {
multi method filter($response where
(.encode.elems > MESSAGE-LIMIT
or (!~$_ and # non-empty are not gisted unless huge
(?.?additional-files or $_ ~~ ProperStr)))) {
# Here $response is a Str with a lot of stuff mixed in (possibly)
my $description = Whateverable;
my $text = colorstrip $response.?long-str // ~$response;
Expand Down

0 comments on commit fda7e52

Please sign in to comment.