From 623bf8ef017ef6b1b8dd5fb6477e444112d294f3 Mon Sep 17 00:00:00 2001 From: eleksir Date: Sat, 14 Nov 2020 19:32:56 +0300 Subject: [PATCH] Add multiline support for outgoing messages in Net::Jabber::Bot --- lib/Net/Jabber/Bot.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Net/Jabber/Bot.pm b/lib/Net/Jabber/Bot.pm index 53c452f..5feb19b 100644 --- a/lib/Net/Jabber/Bot.pm +++ b/lib/Net/Jabber/Bot.pm @@ -1016,9 +1016,9 @@ sub _send_individual_message { return "Server is down.\n"; } - # Strip out anything that's not a printable character + # Strip out anything that's not a printable character except new line, we want to be able to send multiline message, aren't we? # Now with unicode support? - $message_chunk =~ s/[^[:print:]]+/./xmsg; + $message_chunk =~ s/[^[\n|\r|\r\n|:print:]]+/./xmsg; my $message_length = length($message_chunk); DEBUG("Sending message $yday-$hour-$messages_this_hour $message_length bytes to $recipient");