parent
ed50aa0d8e
commit
4f6f654e34
|
@ -791,6 +791,10 @@ void Updates::mtpUpdateReceived(const MTPUpdates &updates) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32 Updates::pts() const {
|
||||||
|
return _ptsWaiter.current();
|
||||||
|
}
|
||||||
|
|
||||||
void Updates::updateOnline() {
|
void Updates::updateOnline() {
|
||||||
updateOnline(false);
|
updateOnline(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ public:
|
||||||
void applyUpdatesNoPtsCheck(const MTPUpdates &updates);
|
void applyUpdatesNoPtsCheck(const MTPUpdates &updates);
|
||||||
void applyUpdateNoPtsCheck(const MTPUpdate &update);
|
void applyUpdateNoPtsCheck(const MTPUpdate &update);
|
||||||
|
|
||||||
|
[[nodiscard]] int32 pts() const;
|
||||||
|
|
||||||
void updateOnline();
|
void updateOnline();
|
||||||
[[nodiscard]] bool isIdle() const;
|
[[nodiscard]] bool isIdle() const;
|
||||||
void checkIdleFinish();
|
void checkIdleFinish();
|
||||||
|
|
|
@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "history/view/media/history_view_media.h" // AddTimestampLinks.
|
#include "history/view/media/history_view_media.h" // AddTimestampLinks.
|
||||||
#include "chat_helpers/stickers_emoji_pack.h"
|
#include "chat_helpers/stickers_emoji_pack.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
#include "api/api_updates.h"
|
||||||
#include "boxes/share_box.h"
|
#include "boxes/share_box.h"
|
||||||
#include "boxes/confirm_box.h"
|
#include "boxes/confirm_box.h"
|
||||||
#include "ui/toast/toast.h"
|
#include "ui/toast/toast.h"
|
||||||
|
@ -1083,6 +1084,17 @@ void HistoryMessage::createComponents(const CreateConfig &config) {
|
||||||
_fromNameVersion = from ? from->nameVersion : 1;
|
_fromNameVersion = from ? from->nameVersion : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HistoryMessage::checkRepliesPts(const MTPMessageReplies &data) const {
|
||||||
|
const auto channel = history()->peer->asChannel();
|
||||||
|
const auto pts = channel
|
||||||
|
? channel->pts()
|
||||||
|
: history()->session().updates().pts();
|
||||||
|
const auto repliesPts = data.match([&](const MTPDmessageReplies &data) {
|
||||||
|
return data.vreplies_pts().v;
|
||||||
|
});
|
||||||
|
return (repliesPts >= pts);
|
||||||
|
}
|
||||||
|
|
||||||
void HistoryMessage::setupForwardedComponent(const CreateConfig &config) {
|
void HistoryMessage::setupForwardedComponent(const CreateConfig &config) {
|
||||||
const auto forwarded = Get<HistoryMessageForwarded>();
|
const auto forwarded = Get<HistoryMessageForwarded>();
|
||||||
if (!forwarded) {
|
if (!forwarded) {
|
||||||
|
@ -1317,7 +1329,9 @@ void HistoryMessage::applyEdition(const MTPDmessage &message) {
|
||||||
setForwardsCount(message.vforwards().value_or(-1));
|
setForwardsCount(message.vforwards().value_or(-1));
|
||||||
setText(_media ? textWithEntities : EnsureNonEmpty(textWithEntities));
|
setText(_media ? textWithEntities : EnsureNonEmpty(textWithEntities));
|
||||||
if (const auto replies = message.vreplies()) {
|
if (const auto replies = message.vreplies()) {
|
||||||
|
if (checkRepliesPts(*replies)) {
|
||||||
setReplies(*replies);
|
setReplies(*replies);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
clearReplies();
|
clearReplies();
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,6 +236,8 @@ private:
|
||||||
const TextWithEntities &textWithEntities) const;
|
const TextWithEntities &textWithEntities) const;
|
||||||
void reapplyText();
|
void reapplyText();
|
||||||
|
|
||||||
|
[[nodiscard]] bool checkRepliesPts(const MTPMessageReplies &data) const;
|
||||||
|
|
||||||
QString _timeText;
|
QString _timeText;
|
||||||
int _timeWidth = 0;
|
int _timeWidth = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue