From 314febee3a49ef8bbd2bfaeafdd80a6abd00fa83 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 24 Nov 2025 18:43:32 +0100 Subject: [PATCH] Added message size rendering limit to conversation view. Fixes #93. --- sbapp/ui/messages.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbapp/ui/messages.py b/sbapp/ui/messages.py index acf8230..f32df78 100644 --- a/sbapp/ui/messages.py +++ b/sbapp/ui/messages.py @@ -49,6 +49,8 @@ if RNS.vendor.platformutils.is_darwin(): from kivy.lang.builder import Builder from kivymd.uix.list import OneLineIconListItem, IconLeftWidget +MSG_RENDER_LIMIT = 11000 + class DialogItem(OneLineIconListItem): divider = None icon = StringProperty() @@ -735,8 +737,11 @@ class Messages(): alstr = RNS.prettysize(len(audio_field[1])) heading_str += f"\n[b]Audio Message[/b] ({alstr})" + final_content = pre_content+message_markup.decode("utf-8")+extra_content + if len(final_content) > MSG_RENDER_LIMIT: + final_content = pre_content+"[i]The content of this message is too large to display in the message stream. You can copy the message content into another program by using the context menu of this message, and selecting [b]Copy[/b].[/i]"+extra_content item = ListLXMessageCard( - text=pre_content+message_markup.decode("utf-8")+extra_content, + text=final_content, heading=heading_str, md_bg_color=msg_color, )