mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 01:10:13 +00:00
Don't refresh large emoji messages when sent.
This commit is contained in:
parent
bc83df9d7f
commit
d7f7a03eb4
@ -1629,11 +1629,10 @@ bool Session::checkEntitiesAndViewsUpdate(const MTPDmessage &data) {
|
||||
return result;
|
||||
}();
|
||||
if (const auto existing = message(peerToChannel(peer), data.vid().v)) {
|
||||
existing->setText({
|
||||
existing->updateSentContent({
|
||||
qs(data.vmessage()),
|
||||
TextUtilities::EntitiesFromMTP(data.ventities().value_or_empty())
|
||||
});
|
||||
existing->updateSentMedia(data.vmedia());
|
||||
}, data.vmedia());
|
||||
existing->updateReplyMarkup(data.vreply_markup());
|
||||
existing->updateForwardedInfo(data.vfwd_from());
|
||||
existing->setViewsCount(data.vviews().value_or(-1));
|
||||
|
@ -594,7 +594,9 @@ HistoryItem *History::createItem(
|
||||
result->removeMainView();
|
||||
}
|
||||
if (message.type() == mtpc_message) {
|
||||
result->updateSentMedia(message.c_message().vmedia());
|
||||
result->updateSentContent(
|
||||
result->originalText(),
|
||||
message.c_message().vmedia());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -196,7 +196,9 @@ public:
|
||||
virtual void applyEdition(const MTPDmessageService &message) {
|
||||
}
|
||||
void applyEditionToHistoryCleared();
|
||||
virtual void updateSentMedia(const MTPMessageMedia *media) {
|
||||
virtual void updateSentContent(
|
||||
const TextWithEntities &textWithEntities,
|
||||
const MTPMessageMedia *media) {
|
||||
}
|
||||
virtual void updateReplyMarkup(const MTPReplyMarkup *markup) {
|
||||
}
|
||||
|
@ -1014,13 +1014,17 @@ void HistoryMessage::applyEdition(const MTPDmessageService &message) {
|
||||
}
|
||||
}
|
||||
|
||||
void HistoryMessage::updateSentMedia(const MTPMessageMedia *media) {
|
||||
void HistoryMessage::updateSentContent(
|
||||
const TextWithEntities &textWithEntities,
|
||||
const MTPMessageMedia *media) {
|
||||
const auto isolated = isolatedEmoji();
|
||||
setText(textWithEntities);
|
||||
if (_flags & MTPDmessage_ClientFlag::f_from_inline_bot) {
|
||||
if (!media || !_media || !_media->updateInlineResultMedia(*media)) {
|
||||
refreshSentMedia(media);
|
||||
}
|
||||
_flags &= ~MTPDmessage_ClientFlag::f_from_inline_bot;
|
||||
} else {
|
||||
} else if (media || _media || !isolated || isolated != isolatedEmoji()) {
|
||||
if (!media || !_media || !_media->updateSentMedia(*media)) {
|
||||
refreshSentMedia(media);
|
||||
}
|
||||
|
@ -122,7 +122,9 @@ public:
|
||||
|
||||
void applyEdition(const MTPDmessage &message) override;
|
||||
void applyEdition(const MTPDmessageService &message) override;
|
||||
void updateSentMedia(const MTPMessageMedia *media) override;
|
||||
void updateSentContent(
|
||||
const TextWithEntities &textWithEntities,
|
||||
const MTPMessageMedia *media) override;
|
||||
void updateReplyMarkup(const MTPReplyMarkup *markup) override {
|
||||
setReplyMarkup(markup);
|
||||
}
|
||||
|
@ -3817,11 +3817,10 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) {
|
||||
item->id,
|
||||
ApiWrap::RequestMessageDataCallback());
|
||||
}
|
||||
item->setText({
|
||||
item->updateSentContent({
|
||||
sent.text,
|
||||
TextUtilities::EntitiesFromMTP(list.value_or_empty())
|
||||
});
|
||||
item->updateSentMedia(d.vmedia());
|
||||
}, d.vmedia());
|
||||
if (const auto channel = item->history()->peer->asChannel()) {
|
||||
channel->growSlowmodeLastMessage(d.vdate().v);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user