Support server-provided limits for rich messages.

This commit is contained in:
John Preston
2026-06-02 17:23:09 +04:00
parent 2cbb2425d4
commit 8b8b3ebc09
32 changed files with 1081 additions and 214 deletions
+5 -1
View File
@@ -92,6 +92,7 @@ namespace Data {
namespace {
constexpr auto kNextForUpgradeGiftTimeout = 5 * crl::time(1000);
constexpr auto kMaxServiceNotificationMessageSize = 4096;
using ViewElement = HistoryView::Element;
@@ -5400,7 +5401,10 @@ void Session::insertCheckedServiceNotification(
const auto localFlags = MessageFlag::ClientSideUnread
| MessageFlag::Local;
auto sending = TextWithEntities(), left = message;
while (TextUtilities::CutPart(sending, left, MaxMessageSize)) {
while (TextUtilities::CutPart(
sending,
left,
kMaxServiceNotificationMessageSize)) {
const auto id = nextLocalMessageId();
addNewMessage(
id,