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

Allow sending scheduled messages.

This commit is contained in:
John Preston
2019-08-12 17:33:36 +01:00
parent caef7dde24
commit 03cdddfe18
18 changed files with 336 additions and 180 deletions

View File

@@ -1844,6 +1844,12 @@ void Session::destroyMessage(not_null<HistoryItem*> item) {
list->erase(item->id);
}
MsgId Session::nextLocalMessageId() {
Expects(_localMessageIdCounter < EndClientMsgId);
return _localMessageIdCounter++;
}
HistoryItem *Session::message(ChannelId channelId, MsgId itemId) const {
if (!itemId) {
return nullptr;
@@ -3627,13 +3633,14 @@ void Session::insertCheckedServiceNotification(
const auto flags = MTPDmessage::Flag::f_entities
| MTPDmessage::Flag::f_from_id
| MTPDmessage::Flag::f_media;
const auto clientFlags = MTPDmessage_ClientFlag::f_clientside_unread;
const auto clientFlags = MTPDmessage_ClientFlag::f_clientside_unread
| MTPDmessage_ClientFlag::f_local_history_entry;
auto sending = TextWithEntities(), left = message;
while (TextUtilities::CutPart(sending, left, MaxMessageSize)) {
addNewMessage(
MTP_message(
MTP_flags(flags),
MTP_int(clientMsgId()),
MTP_int(nextLocalMessageId()),
MTP_int(peerToUser(PeerData::kServiceNotificationsId)),
MTP_peerUser(MTP_int(_session->userId())),
MTPMessageFwdHeader(),