2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Some internal HistoryItem refactoring.

Replace most IsServerMsgId / id <=> 0 with isRegular().
Track isLocal / isHistoryEntry in flags.
Remove toHistoryMessage.
This commit is contained in:
John Preston
2021-11-07 12:06:00 +04:00
parent 22b37c4bf8
commit c534f3f22e
52 changed files with 460 additions and 524 deletions

View File

@@ -674,13 +674,13 @@ void Manager::openNotificationMessage(
not_null<History*> history,
MsgId messageId) {
const auto openExactlyMessage = [&] {
if (history->peer->isUser()
|| history->peer->isChannel()
|| !IsServerMsgId(messageId)) {
if (history->peer->isUser() || history->peer->isChannel()) {
return false;
}
const auto item = history->owner().message(history->channelId(), messageId);
if (!item || !item->mentionsMe()) {
const auto item = history->owner().message(
history->channelId(),
messageId);
if (!item || !item->isRegular() || !item->mentionsMe()) {
return false;
}
return true;