2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-06 01:25:18 +00:00

Use getters in MTP classes.

This commit is contained in:
John Preston
2019-07-05 15:38:38 +02:00
parent 3ca28c0cf9
commit 567bf60644
100 changed files with 2807 additions and 2672 deletions

View File

@@ -47,14 +47,13 @@ Draft::Draft(
void applyPeerCloudDraft(PeerId peerId, const MTPDdraftMessage &draft) {
const auto history = Auth().data().history(peerId);
const auto textWithTags = TextWithTags {
qs(draft.vmessage),
qs(draft.vmessage()),
ConvertEntitiesToTextTags(
draft.has_entities()
? TextUtilities::EntitiesFromMTP(draft.ventities.v)
: EntitiesInText())
TextUtilities::EntitiesFromMTP(
draft.ventities().value_or_empty()))
};
auto replyTo = draft.has_reply_to_msg_id() ? draft.vreply_to_msg_id.v : MsgId(0);
if (history->skipCloudDraft(textWithTags.text, replyTo, draft.vdate.v)) {
auto replyTo = draft.vreply_to_msg_id().value_or_empty();
if (history->skipCloudDraft(textWithTags.text, replyTo, draft.vdate().v)) {
return;
}
auto cloudDraft = std::make_unique<Draft>(
@@ -62,7 +61,7 @@ void applyPeerCloudDraft(PeerId peerId, const MTPDdraftMessage &draft) {
replyTo,
MessageCursor(QFIXED_MAX, QFIXED_MAX, QFIXED_MAX),
draft.is_no_webpage());
cloudDraft->date = draft.vdate.v;
cloudDraft->date = draft.vdate().v;
history->setCloudDraft(std::move(cloudDraft));
history->applyCloudDraft();