From 3176ab86a61e66ba4e705e39cd0a9e46103d2c58 Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 12 Dec 2024 19:14:08 -0500 Subject: [PATCH] deal with newlines from owncast --- myapp.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/myapp.pl b/myapp.pl index 8d4075f..ec3a3af 100755 --- a/myapp.pl +++ b/myapp.pl @@ -19,11 +19,11 @@ use Mojo::JSON qw(decode_json); use Mojo::UserAgent; use Mojo::IRC; use Carp qw(croak); -#use Smart::Comments; +use Smart::Comments; use MIME::Base64 qw(encode_base64); ## no critic (prototype) -our $VERSION = '0.2'; # not 100% stress tested +our $VERSION = '0.3'; # not 100% stress tested my $streaming_RN = 0; my $stream_stop_time = 0; @@ -308,6 +308,7 @@ sub chat ($c, $hook) { my $name = $hook->{eventData}->{user}->{displayName}; my $color = $hook->{eventData}->{user}->{displayColor}; my $body = $hook->{eventData}->{rawBody}; # no html + $body =~ s|\s\n|/ |g; my $visible = $hook->{eventData}->{visible}; if ($visible) { send_chat_to_irc( '<' . $colors{$color} . "$name" . NORMAL . '>' . " $body");