mirror of
https://github.com/markqvist/Sideband.git
synced 2025-12-26 05:44:39 -05:00
Added message size rendering limit to conversation view. Fixes #93.
This commit is contained in:
parent
1ae7cea2b6
commit
314febee3a
1 changed files with 6 additions and 1 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue