Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-09-12 13:46:02 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-09-12 13:46:02 +0300
commita6639a829fc3546d3493ec091f5ed6cac8b15643 (patch)
tree51d06f1aedadee337a83af02c2b1d8c56663bf7d
parentefd5883983660f91b7be344ff135b08471ff0a2b (diff)
Fix lost modifications of preview text
Messages are processed one, on demand. The processing result is stored to the database. In that process we strip invalid characters from the preview text and cut it to database column width. If a message is processed and converted into response JSON, the stripping and cutting didn't have an effect for the in memory objects. Only messages loaded from the database cache had a stripped and cut json representation. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--lib/Db/MessageMapper.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Db/MessageMapper.php b/lib/Db/MessageMapper.php
index 5d62e9093..b63896374 100644
--- a/lib/Db/MessageMapper.php
+++ b/lib/Db/MessageMapper.php
@@ -499,6 +499,8 @@ class MessageMapper extends QBMapper {
$previewText = null;
if ($message->getPreviewText() !== null) {
$previewText = mb_strcut(mb_convert_encoding($message->getPreviewText(), 'UTF-8', 'UTF-8'), 0, 255);
+ // Make sure modifications are visible when these objects are used right away
+ $message->setPreviewText($previewText);
}
$query->setParameter(
'preview_text',