2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Added initial local reference for edited media.

This commit is contained in:
23rd
2019-03-30 21:26:20 +03:00
committed by John Preston
parent 6e69069ba2
commit 145dda843e
3 changed files with 23 additions and 4 deletions

View File

@@ -159,9 +159,9 @@ namespace App {
return false;
}
void updateEditedMessage(const MTPMessage &message) {
message.match([](const MTPDmessageEmpty &) {
}, [](const auto &message) {
void updateEditedMessage(const MTPMessage &m) {
m.match([](const MTPDmessageEmpty &) {
}, [&m](const auto &message) {
auto peerId = peerFromMTP(message.vto_id);
if (message.has_from_id() && peerId == Auth().userPeerId()) {
peerId = peerFromUser(message.vfrom_id);
@@ -170,7 +170,16 @@ namespace App {
peerToChannel(peerId),
message.vid.v);
if (existing) {
existing->applyEdition(message);
auto update = true;
if (existing->isLocalUpdateMedia()) {
if (checkEntitiesAndViewsUpdate(m.c_message())) {
update = false;
existing->setIsLocalUpdateMedia(false);
}
}
if (update) {
existing->applyEdition(message);
}
}
});
}