summaryrefslogtreecommitdiffstats
path: root/Telegram/SourceFiles/history/history_message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Telegram/SourceFiles/history/history_message.cpp')
-rw-r--r--Telegram/SourceFiles/history/history_message.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp
index 6e01d56814..c79bc2ae69 100644
--- a/Telegram/SourceFiles/history/history_message.cpp
+++ b/Telegram/SourceFiles/history/history_message.cpp
@@ -857,7 +857,12 @@ MsgId HistoryMessage::computeRepliesInboxReadTillFull() const {
? history()->owner().historyLoaded(
peerFromChannel(views->commentsMegagroupId))
: history().get();
- return group ? std::max(local, group->inboxReadTillId()) : local;
+ if (const auto megagroup = group->peer->asChannel()) {
+ if (megagroup->amIn()) {
+ return std::max(local, group->inboxReadTillId());
+ }
+ }
+ return local;
}
MsgId HistoryMessage::repliesOutboxReadTill() const {
@@ -891,7 +896,12 @@ MsgId HistoryMessage::computeRepliesOutboxReadTillFull() const {
? history()->owner().historyLoaded(
peerFromChannel(views->commentsMegagroupId))
: history().get();
- return group ? std::max(local, group->outboxReadTillId()) : local;
+ if (const auto megagroup = group->peer->asChannel()) {
+ if (megagroup->amIn()) {
+ return std::max(local, group->outboxReadTillId());
+ }
+ }
+ return local;
}
void HistoryMessage::setRepliesMaxId(MsgId maxId) {