tdesktop/Telegram/SourceFiles/history/history_item.h

624 lines
19 KiB
C
Raw Normal View History

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
2017-04-06 14:38:10 +00:00
#include "base/runtime_composer.h"
2017-08-31 16:28:58 +00:00
#include "base/flags.h"
#include "data/data_media_types.h"
#include "history/history_item_edition.h"
2021-10-02 11:28:21 +00:00
#include "history/history_item_reply_markup.h"
#include <any>
2022-12-14 12:15:46 +00:00
class HiddenSenderInfo;
class History;
struct HistoryMessageReply;
struct HistoryMessageViews;
struct HistoryMessageMarkupData;
struct HistoryMessageReplyMarkup;
struct HistoryMessageTranslation;
2022-12-14 12:15:46 +00:00
struct HistoryServiceDependentData;
enum class HistorySelfDestructType;
struct PreparedServiceText;
class ReplyKeyboard;
struct LanguageId;
namespace base {
template <typename Enum>
class enum_mask;
} // namespace base
namespace Storage {
enum class SharedMediaType : signed char;
using SharedMediaTypesMask = base::enum_mask<SharedMediaType>;
} // namespace Storage
namespace Ui {
class RippleAnimation;
} // namespace Ui
namespace style {
struct BotKeyboardButton;
struct RippleAnimation;
} // namespace style
2018-01-09 17:08:31 +00:00
namespace Data {
struct MessagePosition;
struct RecentReaction;
2022-08-16 11:28:17 +00:00
struct ReactionId;
class Media;
struct MessageReaction;
2019-09-11 09:26:13 +00:00
class MessageReactions;
class ForumTopic;
class Thread;
2022-12-14 12:15:46 +00:00
struct SponsoredFrom;
2018-01-09 17:08:31 +00:00
} // namespace Data
2022-08-15 09:20:17 +00:00
namespace Main {
class Session;
} // namespace Main
namespace Window {
class SessionController;
} // namespace Window
namespace HistoryUnreadThings {
enum class AddType;
} // namespace HistoryUnreadThings
namespace HistoryView {
struct TextState;
struct StateRequest;
enum class CursorState : char;
enum class PointState : char;
enum class Context : char;
class ElementDelegate;
2022-12-14 12:15:46 +00:00
class Element;
class Message;
class Service;
class ServiceMessagePainter;
} // namespace HistoryView
2022-12-14 12:15:46 +00:00
class HistoryItem final : public RuntimeComposer<HistoryItem> {
public:
2022-12-14 12:15:46 +00:00
[[nodiscard]] static std::unique_ptr<Data::Media> CreateMedia(
not_null<HistoryItem*> item,
const MTPMessageMedia &media);
HistoryItem(
not_null<History*> history,
MsgId id,
const MTPDmessage &data,
MessageFlags localFlags);
HistoryItem(
not_null<History*> history,
MsgId id,
2022-12-14 12:15:46 +00:00
const MTPDmessageService &data,
MessageFlags localFlags);
HistoryItem(
not_null<History*> history,
MsgId id,
const MTPDmessageEmpty &data,
2021-07-28 11:55:02 +00:00
MessageFlags localFlags);
2022-12-14 12:15:46 +00:00
HistoryItem( // Sponsored message.
not_null<History*> history,
MsgId id,
Data::SponsoredFrom from,
const TextWithEntities &textWithEntities,
HistoryItem *injectedAfter);
HistoryItem( // Local message.
not_null<History*> history,
MsgId id,
MessageFlags flags,
MsgId replyTo,
UserId viaBotId,
TimeId date,
PeerId from,
const QString &postAuthor,
const TextWithEntities &textWithEntities,
const MTPMessageMedia &media,
HistoryMessageMarkupData &&markup,
uint64 groupedId);
HistoryItem( // Local service message.
not_null<History*> history,
MsgId id,
MessageFlags flags,
TimeId date,
PreparedServiceText &&message,
PeerId from = 0,
PhotoData *photo = nullptr);
HistoryItem( // Local forwarded.
not_null<History*> history,
MsgId id,
MessageFlags flags,
TimeId date,
PeerId from,
const QString &postAuthor,
not_null<HistoryItem*> original,
MsgId topicRootId);
HistoryItem( // Local photo.
not_null<History*> history,
MsgId id,
MessageFlags flags,
MsgId replyTo,
UserId viaBotId,
TimeId date,
PeerId from,
const QString &postAuthor,
not_null<PhotoData*> photo,
const TextWithEntities &caption,
HistoryMessageMarkupData &&markup);
HistoryItem( // Local document.
not_null<History*> history,
MsgId id,
MessageFlags flags,
MsgId replyTo,
UserId viaBotId,
TimeId date,
PeerId from,
const QString &postAuthor,
not_null<DocumentData*> document,
const TextWithEntities &caption,
HistoryMessageMarkupData &&markup);
HistoryItem( // Local game.
not_null<History*> history,
MsgId id,
MessageFlags flags,
MsgId replyTo,
UserId viaBotId,
TimeId date,
PeerId from,
const QString &postAuthor,
not_null<GameData*> game,
HistoryMessageMarkupData &&markup);
~HistoryItem();
2018-02-05 20:19:51 +00:00
struct Destroyer {
void operator()(HistoryItem *value);
};
2022-12-14 12:15:46 +00:00
void dependencyItemRemoved(not_null<HistoryItem*> dependency);
void updateDependencyItem();
[[nodiscard]] MsgId dependencyMsgId() const;
[[nodiscard]] bool notificationReady() const;
[[nodiscard]] PeerData *specialNotificationPeer() const;
2022-12-14 12:15:46 +00:00
void checkBuyButton();
void updateServiceText(PreparedServiceText &&text);
[[nodiscard]] UserData *viaBot() const;
[[nodiscard]] UserData *getMessageBot() const;
[[nodiscard]] bool isHistoryEntry() const;
[[nodiscard]] bool isAdminLogEntry() const;
[[nodiscard]] bool isFromScheduled() const;
[[nodiscard]] bool isScheduled() const;
2021-09-26 18:24:47 +00:00
[[nodiscard]] bool isSponsored() const;
[[nodiscard]] bool skipNotification() const;
[[nodiscard]] bool isUserpicSuggestion() const;
void addLogEntryOriginal(
WebPageId localId,
const QString &label,
const TextWithEntities &content);
[[nodiscard]] not_null<Data::Thread*> notificationThread() const;
[[nodiscard]] not_null<History*> history() const {
return _history;
}
[[nodiscard]] Data::ForumTopic *topic() const;
[[nodiscard]] not_null<PeerData*> from() const {
return _from;
}
[[nodiscard]] HistoryView::Element *mainView() const {
return _mainView;
}
void setMainView(not_null<HistoryView::Element*> view) {
_mainView = view;
}
2018-01-18 13:59:22 +00:00
void refreshMainView();
void clearMainView();
void removeMainView();
void invalidateChatListEntry();
void destroy();
[[nodiscard]] bool out() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::Outgoing;
}
[[nodiscard]] bool isPinned() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::Pinned;
}
[[nodiscard]] bool unread(not_null<Data::Thread*> thread) const;
[[nodiscard]] bool showNotification() const;
void markClientSideAsRead();
[[nodiscard]] bool mentionsMe() const;
[[nodiscard]] bool isUnreadMention() const;
[[nodiscard]] bool hasUnreadReaction() const;
[[nodiscard]] bool isUnreadMedia() const;
[[nodiscard]] bool isIncomingUnreadMedia() const;
[[nodiscard]] bool hasUnreadMediaFlag() const;
void markReactionsRead();
void markMediaAndMentionRead();
2022-01-28 11:44:33 +00:00
bool markContentsRead(bool fromThisClient = false);
void setIsPinned(bool isPinned);
// For edit media in history_message.
2022-12-14 12:15:46 +00:00
void returnSavedMedia();
void savePreviousMedia();
[[nodiscard]] bool isEditingMedia() const;
void clearSavedMedia();
// Zero result means this message is not self-destructing right now.
2022-12-14 12:15:46 +00:00
[[nodiscard]] crl::time getSelfDestructIn(crl::time now);
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool definesReplyKeyboard() const;
2021-07-28 07:33:52 +00:00
[[nodiscard]] ReplyMarkupFlags replyKeyboardFlags() const;
void cacheOnlyEmojiAndSpaces(bool only);
[[nodiscard]] bool isOnlyEmojiAndSpaces() const;
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool hasSwitchInlineButton() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::HasSwitchInlineButton;
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool hasTextLinks() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::HasTextLinks;
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool isGroupEssential() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::IsGroupEssential;
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool isLocalUpdateMedia() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::IsLocalUpdateMedia;
}
void setIsLocalUpdateMedia(bool flag) {
if (flag) {
2021-07-28 11:55:02 +00:00
_flags |= MessageFlag::IsLocalUpdateMedia;
} else {
2021-07-28 11:55:02 +00:00
_flags &= ~MessageFlag::IsLocalUpdateMedia;
}
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool isGroupMigrate() const {
2019-01-22 07:50:21 +00:00
return isGroupEssential() && isEmpty();
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool hasViews() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::HasViews;
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool isPost() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::Post;
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool isSilent() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::Silent;
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool isSending() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::BeingSent;
2019-07-17 14:34:39 +00:00
}
2019-08-01 21:14:19 +00:00
[[nodiscard]] bool hasFailed() const {
2021-07-28 11:55:02 +00:00
return _flags & MessageFlag::SendingFailed;
2019-07-17 14:34:39 +00:00
}
[[nodiscard]] bool hideEditedBadge() const {
return (_flags & MessageFlag::HideEdited);
}
[[nodiscard]] bool isLocal() const {
return _flags & MessageFlag::Local;
}
[[nodiscard]] bool isFakeBotAbout() const {
return _flags & MessageFlag::FakeBotAbout;
}
[[nodiscard]] bool isRegular() const;
[[nodiscard]] bool isUploading() const;
2019-07-17 14:34:39 +00:00
void sendFailed();
2022-12-14 12:15:46 +00:00
[[nodiscard]] int viewsCount() const;
[[nodiscard]] int repliesCount() const;
[[nodiscard]] bool repliesAreComments() const;
[[nodiscard]] bool externalReply() const;
2022-09-12 14:18:31 +00:00
[[nodiscard]] bool hasExtendedMediaPreview() const;
2022-12-14 12:15:46 +00:00
void setCommentsInboxReadTill(MsgId readTillId);
void setCommentsMaxId(MsgId maxId);
void setCommentsPossibleMaxId(MsgId possibleMaxId);
[[nodiscard]] bool areCommentsUnread() const;
2022-12-14 12:15:46 +00:00
[[nodiscard]] FullMsgId commentsItemId() const;
void setCommentsItemId(FullMsgId id);
2022-12-14 12:15:46 +00:00
[[nodiscard]] bool needCheck() const;
2022-12-14 12:15:46 +00:00
[[nodiscard]] bool isService() const;
void applyEdition(HistoryMessageEdition &&edition);
2022-12-14 12:15:46 +00:00
void applyEdition(const MTPDmessageService &message);
void applyEdition(const MTPMessageExtendedMedia &media);
void updateForwardedInfo(const MTPMessageFwdHeader *fwd);
void updateSentContent(
const TextWithEntities &textWithEntities,
const MTPMessageMedia *media);
void applySentMessage(const MTPDmessage &data);
void applySentMessage(
2021-02-02 16:38:30 +00:00
const QString &text,
const MTPDupdateShortSentMessage &data,
bool wasAlready);
2022-12-14 12:15:46 +00:00
void updateReactions(const MTPMessageReactions *reactions);
void applyEditionToHistoryCleared();
void updateReplyMarkup(HistoryMessageMarkupData &&markup);
void contributeToSlowmode(TimeId realDate = 0);
void addToUnreadThings(HistoryUnreadThings::AddType type);
void destroyHistoryEntry();
[[nodiscard]] Storage::SharedMediaTypesMask sharedMediaTypes() const;
2021-02-02 16:38:30 +00:00
void indexAsNewItem();
void removeFromSharedMediaIndex();
2022-12-14 12:15:46 +00:00
[[nodiscard]] QString notificationHeader() const;
[[nodiscard]] TextWithEntities notificationText() const;
using ToPreviewOptions = HistoryView::ToPreviewOptions;
using ItemPreview = HistoryView::ItemPreview;
// Returns text with link-start and link-end commands for service-color highlighting.
// Example: "[link1-start]You:[link1-end] [link1-start]Photo,[link1-end] caption text"
2022-12-14 12:15:46 +00:00
[[nodiscard]] ItemPreview toPreview(ToPreviewOptions options) const;
[[nodiscard]] TextWithEntities inReplyText() const;
[[nodiscard]] const TextWithEntities &originalText() const;
[[nodiscard]] const TextWithEntities &translatedText() const;
[[nodiscard]] TextWithEntities translatedTextWithLocalEntities() const;
2022-12-14 12:15:46 +00:00
[[nodiscard]] const std::vector<ClickHandlerPtr> &customTextLinks() const;
[[nodiscard]] TextForMimeData clipboardText() const;
bool changeViewsCount(int count);
void setForwardsCount(int count);
void setReplies(HistoryMessageRepliesData &&data);
void clearReplies();
void changeRepliesCount(int delta, PeerId replier);
void setReplyFields(
2022-10-04 15:34:45 +00:00
MsgId replyTo,
MsgId replyToTop,
2022-12-14 12:15:46 +00:00
bool isForumPost);
void setPostAuthor(const QString &author);
void setRealId(MsgId newId);
void incrementReplyToTopCounter();
2019-08-12 16:33:36 +00:00
[[nodiscard]] bool emptyText() const {
return _text.empty();
}
2019-08-12 16:33:36 +00:00
[[nodiscard]] bool canPin() const;
2021-11-10 06:10:35 +00:00
[[nodiscard]] bool canBeEdited() const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] bool canStopPoll() const;
[[nodiscard]] bool forbidsForward() const;
[[nodiscard]] bool forbidsSaving() const;
2022-12-14 12:15:46 +00:00
[[nodiscard]] bool allowsSendNow() const;
[[nodiscard]] bool allowsForward() const;
[[nodiscard]] bool allowsEdit(TimeId now) const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] bool canDelete() const;
[[nodiscard]] bool canDeleteForEveryone(TimeId now) const;
[[nodiscard]] bool suggestReport() const;
[[nodiscard]] bool suggestBanReport() const;
[[nodiscard]] bool suggestDeleteAllReport() const;
[[nodiscard]] ChatRestriction requiredSendRight() const;
[[nodiscard]] bool requiresSendInlineRight() const;
[[nodiscard]] std::optional<QString> errorTextForForward(
not_null<Data::Thread*> to) const;
[[nodiscard]] const HistoryMessageTranslation *translation() const;
[[nodiscard]] bool translationShowRequiresCheck(LanguageId to) const;
bool translationShowRequiresRequest(LanguageId to);
void translationDone(LanguageId to, TextWithEntities result);
2019-09-11 09:26:13 +00:00
[[nodiscard]] bool canReact() const;
enum class ReactionSource {
Selector,
Quick,
Existing,
};
void toggleReaction(
const Data::ReactionId &reaction,
ReactionSource source);
void updateReactionsUnknown();
2022-08-16 11:28:17 +00:00
[[nodiscard]] auto reactions() const
-> const std::vector<Data::MessageReaction> &;
[[nodiscard]] auto recentReactions() const
2022-08-16 11:28:17 +00:00
-> const base::flat_map<
Data::ReactionId,
std::vector<Data::RecentReaction>> &;
[[nodiscard]] bool canViewReactions() const;
[[nodiscard]] std::vector<Data::ReactionId> chosenReactions() const;
2022-08-16 11:28:17 +00:00
[[nodiscard]] Data::ReactionId lookupUnreadReaction(
not_null<UserData*> from) const;
2021-12-28 18:20:32 +00:00
[[nodiscard]] crl::time lastReactionsRefreshTime() const;
2019-09-11 09:26:13 +00:00
2019-08-12 16:33:36 +00:00
[[nodiscard]] bool hasDirectLink() const;
[[nodiscard]] FullMsgId fullId() const;
[[nodiscard]] GlobalMsgId globalId() const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] Data::MessagePosition position() const;
[[nodiscard]] TimeId date() const;
[[nodiscard]] static TimeId NewMessageDate(TimeId scheduled);
2019-08-12 16:33:36 +00:00
[[nodiscard]] Data::Media *media() const {
return _media.get();
}
[[nodiscard]] bool computeDropForwardedInfo() const;
2022-12-14 12:15:46 +00:00
void setText(const TextWithEntities &textWithEntities);
2022-12-14 12:15:46 +00:00
[[nodiscard]] MsgId replyToId() const;
[[nodiscard]] MsgId replyToTop() const;
[[nodiscard]] MsgId topicRootId() const;
[[nodiscard]] bool inThread(MsgId rootId) const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] not_null<PeerData*> author() const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] TimeId dateOriginal() const;
[[nodiscard]] PeerData *senderOriginal() const;
[[nodiscard]] const HiddenSenderInfo *hiddenSenderInfo() const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] not_null<PeerData*> fromOriginal() const;
[[nodiscard]] QString authorOriginal() const;
[[nodiscard]] MsgId idOriginal() const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] bool isEmpty() const;
2017-12-13 18:10:48 +00:00
2019-08-12 16:33:36 +00:00
[[nodiscard]] MessageGroupId groupId() const;
2019-08-12 16:33:36 +00:00
[[nodiscard]] const HistoryMessageReplyMarkup *inlineReplyMarkup() const {
2019-05-25 14:42:01 +00:00
return const_cast<HistoryItem*>(this)->inlineReplyMarkup();
}
2019-08-12 16:33:36 +00:00
[[nodiscard]] const ReplyKeyboard *inlineReplyKeyboard() const {
2019-05-25 14:42:01 +00:00
return const_cast<HistoryItem*>(this)->inlineReplyKeyboard();
}
2019-08-12 16:33:36 +00:00
[[nodiscard]] HistoryMessageReplyMarkup *inlineReplyMarkup();
[[nodiscard]] ReplyKeyboard *inlineReplyKeyboard();
2019-05-25 14:42:01 +00:00
[[nodiscard]] ChannelData *discussionPostOriginalSender() const;
[[nodiscard]] bool isDiscussionPost() const;
2020-09-15 08:39:39 +00:00
[[nodiscard]] HistoryItem *lookupDiscussionPostOriginal() const;
[[nodiscard]] PeerData *displayFrom() const;
2022-12-14 12:15:46 +00:00
[[nodiscard]] std::unique_ptr<HistoryView::Element> createView(
not_null<HistoryView::ElementDelegate*> delegate,
2022-12-14 12:15:46 +00:00
HistoryView::Element *replacing = nullptr);
void updateDate(TimeId newDate);
[[nodiscard]] bool canUpdateDate() const;
void customEmojiRepaint();
[[nodiscard]] TimeId ttlDestroyAt() const {
return _ttlDestroyAt;
}
2019-08-12 16:33:36 +00:00
MsgId id;
2022-12-14 12:15:46 +00:00
private:
struct CreateConfig;
struct SavedMediaData {
TextWithEntities text;
std::unique_ptr<Data::Media> media;
};
HistoryItem(
not_null<History*> history,
MsgId id,
2021-07-28 11:55:02 +00:00
MessageFlags flags,
TimeId date,
PeerId from);
2022-12-14 12:15:46 +00:00
void createComponentsHelper(
MessageFlags flags,
MsgId replyTo,
UserId viaBotId,
const QString &postAuthor,
HistoryMessageMarkupData &&markup);
void createComponents(CreateConfig &&config);
void setupForwardedComponent(const CreateConfig &config);
[[nodiscard]] bool generateLocalEntitiesByReply() const;
[[nodiscard]] TextWithEntities withLocalEntities(
const TextWithEntities &textWithEntities) const;
void setTextValue(TextWithEntities text);
[[nodiscard]] bool isTooOldForEdit(TimeId now) const;
[[nodiscard]] bool isLegacyMessage() const {
return _flags & MessageFlag::Legacy;
}
[[nodiscard]] bool checkCommentsLinkedChat(ChannelId id) const;
void setReplyMarkup(HistoryMessageMarkupData &&markup);
void changeReplyToTopCounter(
not_null<HistoryMessageReply*> reply,
int delta);
void refreshRepliesText(
not_null<HistoryMessageViews*> views,
bool forceResize = false);
[[nodiscard]] bool checkRepliesPts(
const HistoryMessageRepliesData &data) const;
[[nodiscard]] HistoryServiceDependentData *GetServiceDependentData();
[[nodiscard]] auto GetServiceDependentData() const
-> const HistoryServiceDependentData *;
void updateDependentServiceText();
bool updateServiceDependent(bool force = false);
void setServiceText(PreparedServiceText &&prepared);
void finishEdition(int oldKeyboardTop);
void finishEditionToEmpty();
2022-12-14 12:15:46 +00:00
void clearDependencyMessage();
void setupChatThemeChange();
void setupTTLChange();
void translationToggle(
not_null<HistoryMessageTranslation*> translation,
bool used);
2022-12-14 12:15:46 +00:00
void setSelfDestruct(HistorySelfDestructType type, int ttlSeconds);
TextWithEntities fromLinkText() const;
ClickHandlerPtr fromLink() const;
void setGroupId(MessageGroupId groupId);
2022-12-14 12:15:46 +00:00
static void FillForwardedInfo(
CreateConfig &config,
const MTPDmessageFwdHeader &data);
void createComponents(const MTPDmessage &data);
void setMedia(const MTPMessageMedia &media);
void applyServiceDateEdition(const MTPDmessageService &data);
void setReactions(const MTPMessageReactions *reactions);
[[nodiscard]] bool changeReactions(const MTPMessageReactions *reactions);
void setServiceMessageByAction(const MTPmessageAction &action);
void applyAction(const MTPMessageAction &action);
void refreshMedia(const MTPMessageMedia *media);
void refreshSentMedia(const MTPMessageMedia *media);
void createServiceFromMtp(const MTPDmessage &message);
void createServiceFromMtp(const MTPDmessageService &message);
void applyTTL(const MTPDmessage &data);
void applyTTL(const MTPDmessageService &data);
2022-12-14 12:15:46 +00:00
void applyTTL(TimeId destroyAt);
2022-12-14 12:15:46 +00:00
// For an invoice button we replace the button text with a "Receipt" key.
// It should show the receipt for the payed invoice. Still let mobile apps do that.
void replaceBuyWithReceiptInMarkup();
2022-12-14 12:15:46 +00:00
void setSponsoredFrom(const Data::SponsoredFrom &from);
[[nodiscard]] PreparedServiceText preparePinnedText();
[[nodiscard]] PreparedServiceText prepareGameScoreText();
[[nodiscard]] PreparedServiceText preparePaymentSentText();
[[nodiscard]] PreparedServiceText prepareInvitedToCallText(
const std::vector<not_null<UserData*>> &users,
CallId linkCallId);
[[nodiscard]] PreparedServiceText prepareCallScheduledText(
TimeId scheduleDate);
const not_null<History*> _history;
const not_null<PeerData*> _from;
MessageFlags _flags = 0;
TextWithEntities _text;
std::unique_ptr<SavedMediaData> _savedLocalEditMediaData;
std::unique_ptr<Data::Media> _media;
2019-09-11 09:26:13 +00:00
std::unique_ptr<Data::MessageReactions> _reactions;
crl::time _reactionsLastRefreshed = 0;
TimeId _date = 0;
TimeId _ttlDestroyAt = 0;
HistoryView::Element *_mainView = nullptr;
2019-05-31 21:51:57 +00:00
MessageGroupId _groupId = MessageGroupId();
2022-12-14 12:15:46 +00:00
friend class HistoryView::Element;
friend class HistoryView::Message;
friend class HistoryView::Service;
friend class HistoryView::ServiceMessagePainter;
2022-12-14 12:15:46 +00:00
};