Browse Source

Fix the quote algorythm, don't trim the lines and stop at the first quote

pull/1009/head
Timothée Jaussoin 4 years ago
parent
commit
a6e4a0abcf
  1. 8
      app/widgets/Chat/Chat.php

8
app/widgets/Chat/Chat.php

@ -1111,14 +1111,16 @@ class Chat extends \Movim\Widget\Base
}
} else {
// Let's try to support "quoted" messages
$quote = '>';
$quote = '> ';
$parent = '';
$remains = '';
$endOfQuote = false;
foreach (explode(PHP_EOL, $message->body) as $line) {
if (substr($line, 0, strlen($quote)) == $quote) {
$parent .= trim(substr($line, strlen($quote)))."\n";
if (substr($line, 0, strlen($quote)) == $quote && $endOfQuote == false) {
$parent .= substr($line, strlen($quote))."\n";
} else {
$endOfQuote = true;
$remains .= $line."\n";
}
}

Loading…
Cancel
Save