2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Don't use MTP* for Message flags.

This commit is contained in:
John Preston
2021-07-28 14:55:02 +03:00
parent 22e77bf3af
commit 116a768fde
30 changed files with 638 additions and 841 deletions

View File

@@ -1964,7 +1964,7 @@ void Session::processMessages(
for (const auto &[position, index] : indices) {
addNewMessage(
data[index],
MTPDmessage_ClientFlags(),
MessageFlags(),
type);
}
}
@@ -2281,7 +2281,7 @@ void Session::unmuteByFinished() {
HistoryItem *Session::addNewMessage(
const MTPMessage &data,
MTPDmessage_ClientFlags clientFlags,
MessageFlags localFlags,
NewMessageType type) {
const auto peerId = PeerFromMessage(data);
if (!peerId) {
@@ -2290,7 +2290,7 @@ HistoryItem *Session::addNewMessage(
const auto result = history(peerId)->addNewMessage(
data,
clientFlags,
localFlags,
type);
if (result && type == NewMessageType::Unread) {
CheckForSwitchInlineButton(result);
@@ -4062,8 +4062,8 @@ 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
| MTPDmessage_ClientFlag::f_local_history_entry;
const auto localFlags = MessageFlag::ClientSideUnread
| MessageFlag::LocalHistoryEntry;
auto sending = TextWithEntities(), left = message;
while (TextUtilities::CutPart(sending, left, MaxMessageSize)) {
addNewMessage(
@@ -4089,7 +4089,7 @@ void Session::insertCheckedServiceNotification(
//MTPMessageReactions(),
MTPVector<MTPRestrictionReason>(),
MTPint()), // ttl_period
clientFlags,
localFlags,
NewMessageType::Unread);
}
sendHistoryChangeNotifications();